import os
import time
folder_path = r"D:\serial_log\2.log"
os.path.getatime(folder_path ) #输出最近访问时间1318921018.0
os.path.getctime(folder_path )
os.path.getmtime(folder_path ) #输出最近修改时间
time.gmtime(os.path.getmtime(folder_path ) #以struct_time形式输出最近修改时间
os.path.getsize(folder_path ) #输出文件大小(字节为单位)
os.path.abspath(folder_path ) #输出绝对路径r"D:\serial_log\2.log"
os.path.normpath(folder_path ) #输出r"D:\serial_log\2.log"