[Python] script per file di log ( linee guida)
efphe
effetom a gmail.com
Gio 18 Gen 2007 21:02:19 CET
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
ERRATA CORRIGE
>>>> from stat import ST_CTIME
^^^^^^^^
>>>> import os
>>>> try:
>>>> stats= os.stat(tuo_file)
>>>> except:
>>>> print 'unexistent file'
>>>> today= datetime.datetime.today()
>>>> file_time= stats[ST_CTIME]
^^^^^^^^ >>>> ctime=
datetime.datetime.fromtimestamp(ctime)
>>>> are_equal= (today- ctime).days and False or True
- --
efphe
Today is Pungenday, the 18th day of Chaos in the YOLD 3173
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFr9JLi7obm7aBjHcRAnRLAJ4mr6xgpY+Zj/rOX9to4CyEVIYV7gCfZSP4
QlPcUQUK4SshF4gD565WG18=
=JXdl
-----END PGP SIGNATURE-----
Maggiori informazioni sulla lista
Python