找不到用什么方式能解决
收起
什么看明白题主要干嘛,输入内容作为文件名不是直接open创建文件就行了?
import os wo=input('输入文件名') if not os.path.exists(wo): os.makedirs(wo) f=open(wo+'/'+wo+'.txt','w',encoding='utf-8') f.write(wo) f.close()
报告相同问题?