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
metaperl / move.py
Created July 8, 2019 13:34 — forked from ikluhsman/move.py
Python: move files to creation date named directories
#!/usr/local/bin/python3
import os, time, shutil, sys
dir = sys.argv[1]
os.chdir(dir)
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