Created
January 22, 2015 02:56
-
-
Save liuzhuan/1314a714f4df6391df9d 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, 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