📜  使用 readlines() 函数将文件中的所有行作为列表读取 - Python 代码示例

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

代码示例1
# Program to read all the lines as a list in a file
#  using readlines() function

file = open("python.txt", "r")
content=file.readlines()
print(content)
file.close()