How to get file creation & modification date/times in Python?

前端 未结 13 1986
抹茶落季
抹茶落季 2020-11-21 11:44

I have a script that needs to do some stuff based on file creation & modification dates but has to run on Linux & Windows.

13条回答
  •  一生所求
    2020-11-21 12:07

    >>> import os
    >>> os.stat('feedparser.py').st_mtime
    1136961142.0
    >>> os.stat('feedparser.py').st_ctime
    1222664012.233
    >>> 
    

提交回复
热议问题