将csv导出json格式 import os,csv,json cf = open('D:\OneDrive\\Tech\\Script\\Powershell_Script\\Uxin_work\\VM-Export2012\\VMs.csv','r') for x in csv.DictReader(cf): d = json.dumps(x,indent=6,separators=(',',':'), ensure_ascii=False) #,sort_keys=True print d