python3.X 以日期为名字输出txt文件应该怎么写?

2024-07-18 11:16:58
推荐回答(1个)
回答1:

import time
st=time.strftime("%Y%m%d",time.localtime())
file=open("note"+st+".txt",'w')