Just to give an option, writing a dictionary to csv file could also be done with the pandas package. With the given example it could be something like this:
mydict = {'key1': 'a', 'key2': 'b', 'key3': 'c'}
import pandas as pd
(pd.DataFrame.from_dict(data=mydict, orient='index')
.to_csv('dict_file.csv', header=False))
The main thing to take into account is to set the 'orient' parameter to 'index' inside the from_dict method. This lets you choose if you want to write each dictionary key in a new row.
Additionaly, inside the to_csv method the header parameter is set to False just to have only the dictionary elements without annoying rows. You can always set column and index names inside the to_csv method.
Your output would look like this:
key1,a
key2,b
key3,c
If instead you want the keys to be the column's names, just use the default 'orient' parameter that is 'columns', as you could check in the documentation links.