1.#coding=utf-8
#写文件 存在的
f=open("D:\BaiduYunDownload\Test.txt","w")
f.write("test")
f.write(u"中国")
f.close()
#读文件 存在的
q=open("D:\BaiduYunDownload\Test.txt","r")
c=q.read()
print(c)
#写入没有存在的文件
w=open("D:\BaiduYunDownload\New.txt","w")
w.write(u"测试吧,中国骚年")
w.write("fsdf\n")
print(w.tell())
p=[",,","11","22","\n"]
w.writelines(p)
w.writelines(p)
w.close()
浙公网安备 33010602011771号