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

print(f.readline())
print(f.readline())
运行结果: