将.txt文件中的内容放入列表中 .txt文件如下: 代码实现: with open('F:/F/python_code/00.txt') as f: a = f.readlines() b = [n[:-1] for n in a] print(b)