with语句

# with代码块执行完毕后,内部会自动关闭并释放文件资源
with open('wuenda.txt','r',encoding='utf-8') as f1,
open('test.txt','r',encoding='utf-8') as f2:
for line in f1:
print(line)
for line in f2:
print(line)
原文地址:https://www.cnblogs.com/ceceliahappycoding/p/8337946.html