spath="D:/abc.txt"
f=open(spath,"w")#Opens file for writing.Creates this file doesn't exists.
f.write("First line 1./n")
f.writelines("Fist line 2.")
f.close()
f=open(spath,"r")#Opens file for reading
for line in f:
print line
f.close()
写文件
最新推荐文章于 2022-01-04 21:37:16 发布
3万+

被折叠的 条评论
为什么被折叠?



