Skip to content

Instantly share code, notes, and snippets.

@jhillacre
Created August 20, 2016 04:08
Show Gist options
  • Save jhillacre/f380a589f2e6e293830b8bd3f49dd5e7 to your computer and use it in GitHub Desktop.
Save jhillacre/f380a589f2e6e293830b8bd3f49dd5e7 to your computer and use it in GitHub Desktop.
from datetime import datetime
from operator import itemgetter
files = [
{
filename: '1.file',
mtime: datetime.now()
},
{
filename: '2.file',
mtime: datetime.today()
}
]
files = sorted(files, key=itemgetter('mtime'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment