Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

csv library python convert dict to csv

import csv
my_dict = {'1': 'aaa', '2': 'bbb', '3': 'ccc'}
with open('test.csv', 'w') as f:
    for key in my_dict.keys():
        f.write("%s,%s
"%(key,my_dict[key]))
 
PREVIOUS NEXT
Tagged: #csv #library #python #convert #dict #csv
ADD COMMENT
Topic
Name
4+9 =