This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Goes a little something like this: | |
import os | |
files = [ f for f in os.listdir('.') if os.path.isfile(os.path.join('.',f)) and f.endswith('.jpg') ] | |
for i, file in enumerate(sorted(files)): | |
os.rename(file, 'image%03d.jpg' % i) | |
# Now with them renamed you can do something like: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, random, shutil | |
#Prompting user to enter number of files to select randomly along with directory | |
source=input("Enter the Source Directory : ") | |
dest=input("Enter the Destination Directory : ") | |
no_of_files=int(input("Enter The Number of Files To Select : ")) | |
print("%"*25+"{ Details Of Transfer }"+"%"*25) | |
print("\n\nList of Files Moved to %s :-"%(dest)) |