Best way to parse file into db-type layout?

Michael Hoffman cam.ac.uk at mh391.invalid
Fri Apr 29 18:21:43 EDT 2005


John Machin wrote:
> [Michael Hoffman]:
> 
>>for row in csv.reader(fileinput.input()):
> 
> csv.reader requires that if the first arg is a file that it be opened
> in binary mode.

fileinput.input() is not a file.

I have tested this code and it works fine for the provided example.
-- 
Michael Hoffman



More information about the Python-list mailing list