Pretty new to python, and the documentation for csv files is a bit confusing.
I have a dictionary that looks like the following:
key1: (value1, value2)
I would use pandas, it can be done in one line:
import pandas as pd dic = {'key1':['v1','v2'], 'key2':['vv','gg']} pd.DataFrame(dic).T.reset_index().to_csv('myfile.csv', header=False, index=False)