📅  最后修改于: 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