📜  将文件附加到列表 python 代码示例

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

代码示例2
list=[]
f = open('file.txt','r')

for line in f:
    list.append(line.rstrip())  #if you want the \n replace rstrip by strip