关键词 with保证如文件类的对象在使用完之后的对象置空(清理)。
with open("myfile.txt") as f:
for line in f:
print(line, end="")
.
————Blueicex 2020/2/22 22:39 [email protected]
关键词 with保证如文件类的对象在使用完之后的对象置空(清理)。
with open("myfile.txt") as f:
for line in f:
print(line, end="")
.
————Blueicex 2020/2/22 22:39 [email protected]