Afficher des informations sur un fichier

Author:

 fichier, date
{filelink=16415}

import os, time
 
fichier= 'c:/test.txt'
 
# Taille de fichier en octets
print os.path.getsize(fichier)
 
# Date  de dernier accès au fichier
print time.ctime(os.path.getatime(fichier))
 
# Date de modification du fichier en seconde
print time.ctime(os.path.getmtime(fichier))

Livres Sur ce Sujet

Apprendre à programmer avec Python 3 Apprenez à programmer en Python Python : Petit guide à l’usage du développeur agile Apprendre à programmer avec Python 3 : Avec plus de 50 pages de corigés d’exercices !

Leave a Reply

Your email address will not be published. Required fields are marked *


1 + = nine