Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 293 Bytes

sort-puzzle-books.py.md

File metadata and controls

12 lines (9 loc) · 293 Bytes

sort-puzzle-books.py

Something I use for a "stash" of mine

import os

with open('puzzle-books') as f:
    puzzle_books = [line.rstrip() for line in f.readlines()]

    for book in reversed(sorted(puzzle_books, key=lambda book: os.path.getmtime(book))):
        print(book)