Skip to content

Instantly share code, notes, and snippets.

@DavidLutton
Created October 11, 2019 06:45
Show Gist options
  • Save DavidLutton/a02f6ce14cb4d8852b11d9a2b4bea77f to your computer and use it in GitHub Desktop.
Save DavidLutton/a02f6ce14cb4d8852b11d9a2b4bea77f to your computer and use it in GitHub Desktop.
from pathlib import Path
older, newer = sorted(list(Path('.').glob('prefix_????-??-??.ext')))[-2:] # last 2 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment