# 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 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦