# 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')
打开App,阅读手记