# 文件对象又称文件句柄 # with open("a.txt", mode="rt") as f1: # res = f1.read() # print(res) with open("a.txt", mode="rt") as f1, open("b.txt", mode="rt") as f2: res1 = f1.read() res2 = f2.read() print(res1) print(res2) """ 换行的写法: with open("a.txt", mode="rt") as f1,\ open("b.txt", mode="rt") as f2: """