Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save discarn8/1379e650852c297a1c6e308e440fd3f5 to your computer and use it in GitHub Desktop.
Save discarn8/1379e650852c297a1c6e308e440fd3f5 to your computer and use it in GitHub Desktop.
Python_list_specific_filetypes_with_mod-date_in_directory
import os
#import glob
#import time
path = "C:/path/to?files/*.csv"
for fname in glob.glob(path):
temp1=os.path.basename(os.path.normpath(fname))
filename=temp1.split('.')[0]
dt=time.strftime('%Y%m%d', time.gmtime(os.path.getmtime(fname)))
print(filename+","+dt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment