Computer >> Computer tutorials >  >> Programming >> Python

How to check file last access time using Python?


For getting the modification time for a file, you can use the os.path.getmtime(path). It is supported cross-platform.

example

>>> import os
>>> print os.path.getmtime('my_file.txt')
1505928275.3081832