用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()

 

posted on 2019-08-15 16:53  矮油~  阅读(1136)  评论(0编辑  收藏  举报

导航