I am trying to save output from a module to CSV file and I got an error when I ran the following code, which is a part of a module:
base_keys = ['path', 'rDATE', 'cDate', 'cik', 'risk', 'word_count']
outFile = open('c:\\Users\\ahn_133\\Desktop\\Python Project\\MinkAhn_completed2.csv','wb')
dWriter = csv.DictWriter(outFile, fieldnames=base_keys)
dWriter.writerow(headerDict)
Here is the error message (base_keys are the headings.)
return self.writer.writerow(self._dict_to_list(rowdict))
TypeError: 'str' does not support the buffer interface
I dont' even understand what the error message is about. I use Python 3.3 and Windows 7.
Thanks for your time.
_dict_to_list._dict_to_listreturning? If it's well-named, it's a list, but maybe it isn't.