Io uso il seguente codice per ottenere la data di modifica del file se esso esiste:Ottenere file di data di modifica in Python
if os.path.isfile(file_name):
last_modified_date = datetime.fromtimestamp(os.path.getmtime(file_name))
else:
last_modified_date = datetime.fromtimestamp(0)
Esiste un modo più elegante/short?
Credo che questo risponda alla tua domanda. http://stackoverflow.com/questions/237079/how-to-get-file-creation-modification-date-times-in-python –