Skip to content

Instantly share code, notes, and snippets.

View metaperl's full-sized avatar

Structure and Interpretation of Computer Programs metaperl

View GitHub Profile
metaperl /
Created July 8, 2019 13:34 — forked from ikluhsman/
Python: move files to creation date named directories
import os, time, shutil, sys
dir = sys.argv[1]
for f in os.listdir('.'):
ftime = time.gmtime(os.path.getmtime(f))
year = str(ftime.tm_year)
mon = str(ftime.tm_mon)
day = str(ftime.tm_mday)
if len(mon) == 1: mon = "0" + mon