Skip to content

Instantly share code, notes, and snippets.

@AnmolTomer
Created October 8, 2019 20:19
Show Gist options
  • Save AnmolTomer/2771bb2bee3a4cffeb6e726841be4b8e to your computer and use it in GitHub Desktop.
Save AnmolTomer/2771bb2bee3a4cffeb6e726841be4b8e to your computer and use it in GitHub Desktop.
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