動作確認
Raspberry Pi2 + raspbian
send.txt というファイルの最終更新日を使って、message stationのメッセージ投函日にしようかと検討中。
ファイルパスから最終更新日を取得するのは以下でできた。
160308_fileLastModificationDate.py
import os.path
import time
filepath = "/home/pi/BYOP/send.txt"
mddt = time.ctime(os.path.getmtime(filepath))
print mddt
結果
Mon Mar 7 07:18:45 2016
ここから[年月日]の数値を読み取る方法を調べる。