When run in a directory of gifs, this numbers them and makes an a b c d
animation go a b c d d c b a
.
Created
March 29, 2013 14:46
-
-
Save tmcw/5271286 to your computer and use it in GitHub Desktop.
A little helper for there and back again gifs
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 glob, shutil | |
num = [(int(n.split('.')[0]), n) for n in glob.glob('*.gif')] | |
m = max(map(lambda x: x[0], num)) | |
i = 0 | |
for n, f in reversed(num): | |
i = i + 1 | |
print "%06d.gif" % (m + i) | |
shutil.copyfile(f, "%06d.gif" % (m + i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment