あるフリーランスエンジニアの色んなメモ!! ITスキル・ライフハックとか

Python:ファイルのtimestampを取得する

実装例

import os

# epoch(Unixtime)がfloat型で返却される
os.path.getmtime('ファイルパス')

参考

10.1. os.path — 共通のパス名操作
https://docs.python.org/ja/2.7/library/os.path.html#os.path.getmtime

comments powered by Disqus