programming-examples/python/Basics/Sort files by date.py
2019-11-18 14:44:36 +01:00

6 lines
122 B
Python

import glob
import os
files = glob.glob("*.txt")
files.sort(key=os.path.getmtime)
print("\n".join(files))