Skip to content

Instantly share code, notes, and snippets.

@Trshant
Created November 11, 2013 05:41
Show Gist options
  • Save Trshant/7408442 to your computer and use it in GitHub Desktop.
Save Trshant/7408442 to your computer and use it in GitHub Desktop.
Made a Python script which automates folder creation, each named for ever day of the year like 01012012.....01022012, 02022012.....31122012.
from datetime import datetime , timedelta
import os
dt_obj = datetime(2012, 1, 1, 17, 53, 59)
for i in range(0,366):
dt_obj2 = dt_obj + timedelta(days=i)
os.makedirs( dt_obj2.strftime("%Y%m%d") )
print "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment