我试图写入文本文件,但它保持空白
file = open('AIs.txt', 'w')
file.write(name)
file.close()
这是围绕它的代码,也许这会有所帮助
currentDT = datetime.datetime.now()
date = currentDT.strftime("%d:%m:%y %H:%M:%S")
name = f'AI {date}'
with open(f'{name}.pkl', 'wb') as output:
pickle.dump(genome, output, 1)
file = open('AIs.txt', 'w')
file.write(name)
file.close()
os.execl(sys.executable, sys.executable, * sys.argv)
我尝试使用写入文本文件
with open('AIs.txt', 'w') as file:
等,但这也不起作用