with open() 可以读取多个文件: with open(r'd:\a.txt') as f1,open(r'd:\b.txt') as f2: print(f1.read()) print(f2.read()) 优势:可以省略close()操作