文件的内容读写(一)

写入文件

res='hello world'

f=open('123.txt','w',encording='utf-8')

f.write(f)

f.close

读文件

f=open('123','r',encording='utf-8')

f.read

f.close

原文地址:https://www.cnblogs.com/pangniu1234/p/10700906.html