python txt转换csv 快速
import csv csvFile = open("/Users/wyc/work/geneSearch/server/search/datas_train.csv",'w',newline='',encoding='utf-8') writer = csv.writer(csvFile) csvRow = [] f = open("/Users/wyc/work/geneSearch/server/search/test-20220607.txt",'r') for line in f: csvRow = line.split() writer.writerow(csvRow) f.close() csvFile.close()