aa = "12345678"
with open("数字.txt","w",encoding='utf-8')as f:
f.write(aa)
#这样文件写入后不需要写aa.close()
python 文件写入自动关闭方法
最新推荐文章于 2025-01-12 08:03:07 发布

aa = "12345678"
with open("数字.txt","w",encoding='utf-8')as f:
f.write(aa)
#这样文件写入后不需要写aa.close()