-
Notifications
You must be signed in to change notification settings - Fork 7
Scripts related to devnotes
Louis Maddox edited this page Jan 8, 2018
·
4 revisions
After downloading the devnotes wiki as a git repo, it's helpful to use some scripting to work with the files
with os.scandir(path) as it:
wikilist = [x for entry in it if not entry.name.startswith('.') and entry.is_file()]
wikilist.sort(key=lambda x: stat(x).st_mtime)
wikilist.reverse()
i = len([x for x in wikilist if stat(x).st_mtime == stat(wikilist[0]).st_mtime])
print('\n'.join([x.name+"\t"+x.stat() for x in wikilist[0:i]]))- N.B. to get to normal datetime format:
from datetime import datetime as dt str(dt.fromtimestamp(teststat.st_mtime)).split(' ')[0]