写入txt文件 f = open(path, 'w') for line in Data_list: # 数据列表 f.write(str(line) + "\n") f.close() 写入csv文件 # Data_list为1维列表则需要加[] with open(