Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.104 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.81; '*S*': 0.02; 'example:': 0.03; 'beginner': 0.05; 'column': 0.07; 'cc:addr:python-list': 0.11; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'skip:- 40': 0.29; 'message- id:@mail.gmail.com': 0.30; 'subject:Database': 0.31; 'date:': 0.34; 'subject:from': 0.34; 'subject: (': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'wrong': 0.37; 'email addr:python.org': 0.37; 'skip:[ 10': 0.38; 'subject:': 0.39; 'most': 0.60; "you're": 0.61; 'email addr:gmail.com': 0.63; 're:': 0.63; 'skip:n 10': 0.64; 'total': 0.65; 'email name:python-list': 0.65; 'online': 0.71; 'subject:Online': 0.96; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3A9XI1qDf7OzSNfBo6nbfN3dRTqeP1zDjPxtSQq98Ew=; b=HvdhhDvHCyTnAOxwfjoi+XCL8becxh9NFdtw87lkHFkDgSrZZc85fPxyUY/VJm4XF/ ekoySYPlGOEnZXNAqPw2S0mAIXAcS2S8Yj2tEjMXb+l3gTfriWY/kt0+AZTJb+UmiaL8 BciHd31tLRng066GI/mo0L0Yl/m7Sk5yd1LCuo8CUAaBrCF7Pfe3jjYQdphTTCc9/Z2x GPINUZEkzMAVECxpnfzOsd1YbHE/JNmkWEPmmezBvy4Upf5QBLcHVraCAHKlVnHNqlGA 2YT+VrNOgqyUPOQIU/NYCNgTLKmGA/1y2B1OPvsOlhgyoGgdiTSnthCJrWHLkfz3FKm2 3XrQ== MIME-Version: 1.0 X-Received: by 10.52.52.162 with SMTP id u2mr4173107vdo.54.1369723207159; Mon, 27 May 2013 23:40:07 -0700 (PDT) In-Reply-To: References: Date: Tue, 28 May 2013 07:40:07 +0100 Subject: RE: Total Beginner - Extracting Data from a Database Online (Screenshot) From: Phil Connell To: Carlos Nepomuceno Content-Type: multipart/alternative; boundary=089e012950883420a604ddc18946 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369723209 news.xs4all.nl 15890 [2001:888:2000:d::a6]:46070 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46258 --089e012950883420a604ddc18946 Content-Type: text/plain; charset=ISO-8859-1 On 28 May 2013 02:21, "Carlos Nepomuceno" 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@gmail.com > > To: python-list@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 :) --089e012950883420a604ddc18946 Content-Type: text/html; charset=ISO-8859-1


On 28 May 2013 02:21, "Carlos Nepomuceno" <carlosnepomuceno@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@gmail.com
> > To: python-list@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 :)

--089e012950883420a604ddc18946--