New submission from Василь Коломієць:
with open('example.csv') as csvfile:
dialect = csv.Sniffer().sniff(csvfile.read(1024))
csvfile.seek(0)
reader = csv.reader(csvfile, dialect)
# ... process CSV file contents here ...
--
have to be:
...
reader = csv.reader(csvfile, dialect=dialect)
# ... process CSV file contents here ...
It's here:
https://docs.python.org/3.4/library/csv.html
----------
assignee: docs@python
components: Documentation
messages: 258227
nosy: Vasyl Kolomiets, docs@python
priority: normal
severity: normal
status: open
title: CSV-module. The example code don't work. Have to be: reader =
csv.reader(csvfile, dialect=dialect)
type: enhancement
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26116>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com