# coding:utf-8 import os, datetime # path = r'C:\Users\yh\Desktop\补丁\0415版本补丁' # # f = open('e3.txt', 'w', encoding='utf-8') # # for dirpath, dirnames, filenames in os.walk(path): # for filename in filenames: # f.write(os.path.join(dirpath, filename) + '\n') # # print(os.path.join(dirpath, filename)) # 完整路径+文件名 # # print(os.path.join(filename)) # # f.close() with open('e3.txt') as f: file_path_name = f.read().split('\n') f = open('e3_date.txt', 'w') for file in file_path_name: if os.path.exists(file[:-1]): timestamp = os.path.getmtime(file[:-1]) date = datetime.datetime.fromtimestamp(timestamp) f.write(file + ',' + date.strftime('%Y-%m-%d %H:%M:%S') + '\n')
點擊查看更多內容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦