Skip to content

Instantly share code, notes, and snippets.

@aeg
Created August 25, 2020 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aeg/15b3fae5a29468e9924f595964478ac1 to your computer and use it in GitHub Desktop.
Save aeg/15b3fae5a29468e9924f595964478ac1 to your computer and use it in GitHub Desktop.
ある拡張子のファイルを日付順でソートする。
import os
csv_dir='./'
l:list = list(filter(lambda x: x.endswith('.py'), os.listdir(path=csv_dir)))
l.sort (key=lambda x: int(os.path.getctime(csv_dir + '/' + x)),
reverse=True)
print(l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment