2018年1月10日 星期三

Python: Retrieve file properties

Python: Retrieve file properties檢索檔案屬性

Python Basic: Exercise-107 with Solution

Write a Python program to retrieve file properties.
Sample Solution:-

import os.path
import time

print('File         :', __file__)
print('Access time  :', time.ctime(os.path.getatime(__file__)))
print('Modified time:', time.ctime(os.path.getmtime(__file__)))
print('Change time  :', time.ctime(os.path.getctime(__file__)))
print('Size         :', os.path.getsize(__file__))


======= RESTART: F:/Python_APSC/py-ex-basic-107.py ===========
File         : F:/Python_APSC/py-ex-basic-107.py
Access time  : Thu Jan 11 00:00:00 2018
Modified time: Thu Jan 11 15:15:06 2018
Change time  : Thu Jan 11 15:15:04 2018
Size         : 313
>>> 

沒有留言:

張貼留言

Fultter APP控制 WOKWI ESP32 RFID+LED (使用flutter_windows_3.19.1-stable Visual studio 1.108.2 )

Fultter APP控制 WOKWI ESP32 RFID+LED (使用flutter_windows_3.19.1-stable  Visual studio  1.108.2 ) 1) Android studio 環境設定 2) Visual studio  1.108...