Method of sorting by file date. I think you can find a lot of files if you search for Python sort().
python.py
import os
def getfiles(dirpath):
filelist = [s for s in os.listdir(dirpath)
if os.path.isfile(os.path.join(dirpath, s))]
filelist.sort(key=lambda s: os.path.getmtime(os.path.join(dirpath, s)))
return filelist
file1 = getfiles ('file list folder path')
© 2024 OneMinuteCode. All rights reserved.