Skip to content

Instantly share code, notes, and snippets.

@liuzhuan
Created January 22, 2015 02:56
Show Gist options
  • Save liuzhuan/1314a714f4df6391df9d to your computer and use it in GitHub Desktop.
Save liuzhuan/1314a714f4df6391df9d to your computer and use it in GitHub Desktop.
import os, shutil
src = "img"
dest = "newimg"
if os.path.isdir(dest) == False:
os.mkdir(dest)
imgs = os.listdir(src)
i = 1
for img in imgs:
frompic = os.path.join(src, img)
topic = os.path.join(dest, str(i)+".jpg")
shutil.copyfile(frompic, topic)
i = i + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment