How do you check if a file has been modified in Python?

Đạt Michio

New member
How do you check if a file has been modified in Python?
Answer
Monitoring if a file has changed in Python
  1. import os if os. path. exists(“yourpath here”): print “Yep – found it”
  2. import os if os. path. isfile(“your path to file”): print “that’s a file alright”
  3. import md5 hash1 = md5. new() hash1. …
  4. import os, time moddate = os. stat(“filepath”)[8] # there are 10 attributes this call returns and you want the next to last.
3 авг. 2014 г.
 

Tìm kiếm

Back
Top