Total Beginner - Extracting Data from a Database Online (Screenshot)

Phil Connell pconnell at gmail.com
Tue May 28 02:40:07 EDT 2013


On 28 May 2013 02:21, "Carlos Nepomuceno" <carlosnepomuceno at outlook.com>
wrote:
>
> ----------------------------------------
> > Date: Mon, 27 May 2013 17:58:00 -0700
> > Subject: Re: Total Beginner - Extracting Data from a Database Online
(Screenshot)
> > From: logan.c.graham at gmail.com
> > To: python-list at python.org
> [...]
> >
> > Oh goodness, yes, I have no clue.
>
> For example:
>
> # to retrieve the contents of all column '# fb' (11th column from the
image you sent)
>
> c11 = [tables[0][r][10] for r in range(len(tables[0]))]

Or rather:

c11 = [row[10] for row in tables[0]]

In most cases, range(len(x)) is a sign that you're doing it wrong :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130528/b7997e7a/attachment.html>


More information about the Python-list mailing list