Skip to content

Instantly share code, notes, and snippets.

@Andrew-Pynch
Created March 22, 2020 01:15
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 Andrew-Pynch/8a94d0c7ec8fb2491b1400ff33e72f69 to your computer and use it in GitHub Desktop.
Save Andrew-Pynch/8a94d0c7ec8fb2491b1400ff33e72f69 to your computer and use it in GitHub Desktop.
def order_files_by_date(path_to_folder, file_type):
files = glob.glob("%s*%s" % (path_to_folder, file_type))
files.sort(key=os.path.getmtime)
return files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment