编程语言
首页 > 编程语言> > python第九期学习笔记(四)

python第九期学习笔记(四)

作者:互联网

#!/usr/bin/python3
#_*_ coding:utf-8 _*_
#author:inwell
#Time:2019/10/16 11:24

#同时打开多个文件
with open("t1.txt",mode="r",encoding="utf-8") as f1,open("t2.txt",mode="w",encoding="utf-8") as f2:
content=f1.read()
print(content)
f2.write("你是谁,我是谁")
f1.close()
f2.close()


标签:f1,f2,utf,encoding,python,笔记,第九期,close,txt
来源: https://www.cnblogs.com/gaoyuxia/p/11684614.html