I want to get latest 3 ".jpeg" files from a folder using python I tried like
import os
import glob
path = "path of the folder\\*.jpeg"
list_of_files = glob.iglob(path)
latest_file = max(list_of_files, key=os.path.getctime)
print(latest_file)
But I got only one file as output. How to get latest 3 files from a folder?