标签:错误 文件 pat 解码 cep odi int %s filename
filename_path = "./p.txt"
try:
f = open(filename_path,"w",encoding="utf-8") #encoding="utf-8"
print(f.write("作者,啊锋"))
except:
print("%s文件缺失"%(filename_path)) 正确的
filename_path = "./p.txt"
try:
f = open(filename_path,"w")
print(f.write("作者,啊锋"))
except:
print("%s文件缺失"%(filename_path)) 错误的
标签:错误 文件 pat 解码 cep odi int %s filename
原文地址:https://www.cnblogs.com/nishoufeng/p/12016469.html