MySQLdbd error. Perhpas it isn't installed?

Chris Angelico rosuav at gmail.com
Wed Mar 27 22:33:20 EDT 2013


On Thu, Mar 28, 2013 at 1:24 PM, Νίκος Γκρ33κ <nikos.gr33k at gmail.com> wrote:
> I think i have figured this out:
>
> cur.execute( '''SELECT hits FROM counters WHERE url = %s''') , (page,)
>
> is a tuple of two objects. The first is the result of
> cur.execute( '''SELECT hits FROM counters WHERE url = %s''')
> and the second is
> (page,)
>
>
> cur.execute( '''SELECT hits FROM counters WHERE url = %s''' , (page,) )
> is the result of the execute method of the cur object called with two arguments.
>
>
>
>>>> int('10010110101', 2)
> 1205
>>>> int('10010110101'), 2
> (10010110101, 2)
>>>>
>
> Is this correct?

Ah, crossed in the post. Yes, this is correct, as you can confirm with
the operator precedence table that I posted above. (Experienced
programmers would have the universal precedences in their heads, but
the same applies.)

ChrisA



More information about the Python-list mailing list