fix unicode bug

This commit is contained in:
Your Name 2023-03-28 20:31:44 +08:00
parent c80808a0c5
commit 37bcdf684d

View File

@ -47,7 +47,8 @@ def write_results_to_file(history, file_name=None):
"""
import os, time
if file_name is None:
file_name = time.strftime("chatGPT分析报告%Y-%m-%d-%H-%M-%S", time.localtime()) + '.md'
# file_name = time.strftime("chatGPT分析报告%Y-%m-%d-%H-%M-%S", time.localtime()) + '.md'
file_name = 'chatGPT分析报告' + time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) + '.md'
os.makedirs('./gpt_log/', exist_ok=True)
with open(f'./gpt_log/{file_name}', 'w', encoding = 'utf8') as f:
f.write('# chatGPT 分析报告\n')