I have some xml files in a folder as example 'assests/2020/2010.xml'
, 'assests/2020/20005.xml'
, 'assests/2020/20999.xml'
etc. I want to get the filename with max value in the '2020' folder. For above three files output should be 20999.xml
I am trying as following:
import glob
import os
list_of_files = glob.glob('assets/2020/*')
# latest_file = max(list_of_files, key=os.path.getctime)
# print (latest_file)
I couldn't be able to find logic to get the required file. Here is the resource that have best answer to my query but I couldn't build my logic.