You can use the os.path
and os.stat
modules to get the last modified time of a file. Here's an example:
main.py329 chars13 lines
This will print the last modified time of the file in a human-readable format. You can also compare the modified time with the current time to see if the file has been modified since the last time you checked:
main.py207 chars7 lines
gistlibby LogSnag