import os
import time
filename = "test.txt"
info = os.stat(filename)
if time.time()-info.st_mtime > 600:#10分钟
print "done"
else:
print "modify"
时间: 2024-11-05 15:57:27
import os
import time
filename = "test.txt"
info = os.stat(filename)
if time.time()-info.st_mtime > 600:#10分钟
print "done"
else:
print "modify"