要获取文件的修改时间,可以使用os.path.getmtime(path)。支持跨平台。
>>> import os >>> print os.path.getmtime('my_file.txt') 1505928275.3081832