2020
09-24
09-24
Python读写操作csv和excle文件代码实例
1、python读写csv文件importcsv#读取csv文件内容方法1csv_file=csv.reader(open('testdata.csv','r'))next(csv_file,None)#skiptheheadersforuserincsv_file:print(user)#读取csv文件内容方法2withopen('testdata.csv','r')ascsv_file:reader=csv.reader(csv_file)next(csv_file,None)foruserinreader:print(user)#从字典写入csv文件dic={'fengju':25,'wuxia':26}csv_file=open('testdata1....
继续阅读 >