3 ms·
The csv module has it's fair share of quirks to be aware of as well, like not supporting Unicode.
by t1m 12y ago
The csv module has it's fair share of quirks to be aware of as well, like not supporting Unicode.
- juliangregorian 12y agoEven in Python 3?
- mkesper 12y agoIn Python3 it's completely fine, if you open the files with the correct encoding. For Python2, you've got to use UnicodeReader/Writer (and to open in binary mode): https://docs.python.org/2/library/csv.html?highlight=csv#examples https://docs.python.org/2/library/csv.html?highlight=csv#exa...
- mazelife 12y ago...which is why I usually turn to this: https://pypi.python.org/pypi/unicodecsv/0.9.4 https://pypi.python.org/pypi/unicodecsv/0.9.4 It's a "drop-in replacement for Python 2's csv module which supports unicode strings without a hassle."