I\'m trying to write a simple Python script that will copy a index.tpl to index.html in all of the subdirectories (with a few exceptions).
I\'m getting bogged down
import os, os.path
To get (full-path) immediate sub-directories in a directory:
def SubDirPath (d): return filter(os.path.isdir, [os.path.join(d,f) for f in os.listdir(d)])
To get the latest (newest) sub-directory:
def LatestDirectory (d): return max(SubDirPath(d), key=os.path.getmtime)