Created
October 8, 2019 20:19
-
-
Save AnmolTomer/2771bb2bee3a4cffeb6e726841be4b8e to your computer and use it in GitHub Desktop.
This file contains 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 | |
path = input("Enter source path:") | |
images = os.listdir(path) | |
print(images) | |
for f in images: | |
if(".jpg" in f[-4:]): | |
src = path | |
if(f[0]=="0"): | |
dst = src + '/8' + f[1:] | |
elif(f[0]=="3"): | |
dst = src + '/9' + f[1:] | |
src = src + '/' + f | |
os.rename(src,dst) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment