Question on the "csv" library

vsoler vicente.soler at gmail.com
Thu Aug 27 22:12:07 CEST 2009


On Aug 27, 9:42 pm, Andreas Waldenburger <use... at geekmail.INVALID>
wrote:
> On Thu, 27 Aug 2009 21:36:28 +0200 Andreas Waldenburger
>
> <use... at geekmail.INVALID> wrote:
> > [snip]
>
> > Might I humbly suggest
>
> > >>> sheet = list(spamReader)  # ?
>
> Oh, and while I'm humbly suggesting:
>
> spam_reader instead of spamReader or SpamReader or SpamrEadeR or
> suchlike. Caps are "reserved" for classes.
>
> Not a necessity, of course. But it's the dialect around these parts.
>
> /W
>
> --
> INVALID? DE!

Thank you for your answers. Let me however make some comments:

1- the csv file was generated with Excel 2007; no prompts for what the
separator should be; Excel has used ";" by default, without asking
anything

2- about capitalisation, I used the var "spamReader" because I just
copy/pasted from the official python site:

      http://docs.python.org/library/csv.html

3- when I try

>>> sheet = [row for row in spamReader]
>>> print sheet
[]

all I get is an empty list; something seems not to be working properly

Same result list: I get an empty list

     sheet = list(spamReader)

Thank you again for your help, which is highly appreciated.

Vicente Soler



More information about the Python-list mailing list