Created
April 7, 2013 19:43
-
-
Save mikeyakymenko/5332167 to your computer and use it in GitHub Desktop.
Сортировака и копирование картинок в новую директорию. P.S. была такая надабность.
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
#!/usr/bin/env python | |
# coding: utf-8 | |
import os | |
import shutil | |
import urllib | |
def rel(*x): | |
return os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) | |
files = filter(lambda x: x.endswith('@2x.png'), os.listdir(rel())); | |
for item in files: | |
shutil.copyfile(item, rel('files/') + item.replace('@2x.png', '.png')) | |
print files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment