.txt文件如下:
代码实现:
with open('F:/F/python_code/00.txt') as f: a = f.readlines() b = [n[:-1] for n in a] print(b)