Closed justin-water closed 3 months ago
例如:userName-20240517.csv 没接触过Python,尝试修改失败了 修改的是csv_gen.py文件
current_time = time.strftime("%Y-%m-%d %H:%M", time.localtime()) # 获取当前时间并格式化 file_name = f'{screen_name}_{current_time}.csv' # 生成文件名 file_path = f'{save_path}/{file_name}' # 拼接文件路径 self.f = open(file_path, 'w', encoding='utf-8-sig', newline='') self.writer = csv.writer(self.f)
这个修改csv_gen的第6行就行
from datetime import date self.f = open(f'{save_path}/{screen_name}-{date.today()}.csv', 'w', encoding='utf-8-sig', newline='')
例如:userName-20240517.csv 没接触过Python,尝试修改失败了 修改的是csv_gen.py文件