Another Little MySQL Problem

Victor Subervi victorsubervi at gmail.com
Wed May 26 13:37:29 EDT 2010


On Wed, May 26, 2010 at 11:25 AM, Kushal Kumaran
<kushal.kumaran at gmail.com>wrote:

> On Tue, 2010-05-25 at 14:45 -0400, Victor Subervi wrote:
> > Hi;
> > I have this code:
> >
> >     clientCursor.execute('select ID from %s' % (personalDataTable))
> >     upds = [itm[0] for itm in clientCursor]
> >     print "<input type='hidden' name='upds' value='%s' />" % upds
> >
> > The problem is that the values passed are 1L, 2L.... When I retrieve
> > them on the other end and try to convert them to integers, guess what
> > happens? So how do I get rid of that "L"?
>
> You could build a list of ints instead of a list of longs, like this:
>
> upds = [int(itm[0]) for itm in clientCursor]
>

Oh, geez. That should have been obvious to me! Thanks!
beno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100526/374f147b/attachment-0001.html>


More information about the Python-list mailing list