用python读取csv信息并写入新的文件
import csv fo = open("result.txt", "w+") reader = csv.reader(open('test.csv')) for line in reader: Name = line[0] fo.writelines(['class ',Name,'{\n']) fo.writelines('};\n') fo.close()
import csv fo = open("result.txt", "w+") reader = csv.reader(open('test.csv')) for line in reader: Name = line[0] fo.writelines(['class ',Name,'{\n']) fo.writelines('};\n') fo.close()