problem writing to a file each record read

bruno at modulix onurb at xiludom.gro
Wed Mar 15 20:43:44 CET 2006


Eduardo Biano wrote:
> I am a python newbie and I have a problem with writing
> each record read to a file. The expected output is 10
> rows of records, but the actual output of the code
> below is only one row with a very long record (10
> records are lump into one record). Thank you in
> advance for your help. Here is the code:
>   
> ****************************************
> 
> infile = open('c:/grad3650txt.csv', 'r')

Use the csv module. It's in the standard lib. And it'll save you lot of
wasted time and aspirin.

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list