I am trying to find the most recently modified (From here on out \'newest\') file of a specific type in Python. I can currently get the newest, but it doesn\'t matter what
for file in os.listdir(os.getcwd()): if file.endswith(".mp3"): print "",file newest = max(file , key = os.path.getctime) print "Recently modified Docs",newest