code: def save_dict_to_file(filename, dictionary):
    
    with open(filename, 'w') as f:
      writer = csv.writer(f)
      for k, v in iteritems(dictionary):
        writer.writerow([str(k), str(v)])
docs: Saves dictionary as CSV file.