csv - howto specify fmtparam parameters

Helmut Jarausch jarausch at igpm.rwth-aachen.de
Thu Aug 21 03:18:48 EDT 2003


Hi,

according to the docs the following should work (IMHO)

import csv
csv_file= file('test.csv')

Inp= csv.DictReader(csv_file,['Matr','Name','Vorname','PZ','MP'],\
      lineterminator='\n')

for S in Inp:
     print S

but I get
Traceback (most recent call last):
   File "/home/jarausch/Python/My/test_csv.py", line 5, in -toplevel-
     lineterminator='\n')
TypeError: __init__() got an unexpected keyword argument 'lineterminator'

What went wrong?

Thanks for a hint,


Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany





More information about the Python-list mailing list