📜  如何在 python 代码示例中使用 readline

📅  最后修改于: 2022-03-11 14:45:43.057000             🧑  作者: Mango

代码示例2
myFile = open("test.txt,"r")
print(myFile.readline(0))# print the first line of the text file
print(myFile.readline(1))# print the second line of the text file
print(myFile.readline(2))# print the tird line of the text file
# ect..
# you might need to use MyFile.seek(0) after reading