返回的是一个按行切出来的列表 input_file = '/home/zdx/Downloads/XXX.txt' with open(input_file, 'r') as f: data = f.read().splitlines()