Skip to content

Instantly share code, notes, and snippets.

@sjovang
Created March 25, 2012 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjovang/2198618 to your computer and use it in GitHub Desktop.
Save sjovang/2198618 to your computer and use it in GitHub Desktop.
import os, shutil
path = "/home/trond/Donald"
authors = os.listdir(path)
for author in authors:
if author != "cbz":
years = os.listdir(path + "/" + author)
for year in years:
stories = os.listdir(path + "/" + author + "/" + year)
for story in stories:
print path + "/" + author + "/" + year + "/" + story
os.chdir(path + "/" + author + "/" + year)
shutil.make_archive("/home/trond/Donald/cbz/" + author + "/" + year +"_" + story, "zip", story)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment