文件的内容读写

写入文件

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

猜你喜欢

转载自www.cnblogs.com/pangniu1234/p/10700906.html