Skip to content

Instantly share code, notes, and snippets.

@mikeyakymenko
Created April 7, 2013 19:43
Show Gist options
  • Save mikeyakymenko/5332167 to your computer and use it in GitHub Desktop.
Save mikeyakymenko/5332167 to your computer and use it in GitHub Desktop.
Сортировака и копирование картинок в новую директорию. P.S. была такая надабность.
#!/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