# 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)