extra rows in a CSV module output when viewed in excel 2007

JonathanB doulos05 at gmail.com
Fri Aug 20 01:42:50 CEST 2010


On Aug 13, 3:52 pm, alex23 <wuwe... at gmail.com> wrote:
> On Aug 13, 4:22 pm, JonathanB <doulo... at gmail.com> wrote:
>
> >         writer = csv.writer(open(output, 'w'), dialect='excel')
>
> I think - not able to test atm - that if you open the file in 'wb'
> mode instead it should be fine.

changed that to
writer = csv.writer(open(output,'wb'),dialect='excel')

Now I get this error:

TypeError: must be bytes or buffer, not str

I'm using Python 3.1, maybe that changes things?



More information about the Python-list mailing list