Recent | Popular
#python #glob #file #latest
import glob import os list_of_files = glob.glob('/path/to/folder/*') # * means all if need specific format then *.csv latest_file = max(list_of_files, key=os.path.getctime) print latest_file
Wed Oct 28 2020 02:09:48 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/39327032/how-to-get-the-latest-file-in-a-folder-using-python