代码示例:(标识:python_file_close)
python_file_close.py
f = open("demofile.txt", "r")

print(f.readline())

f.close()
运行结果: