string to integer problem

Diez B. Roggisch deets_noospaam at web.de
Sun Feb 8 12:00:11 EST 2004


> I'm currently having problems with data returned from a MySQL database in
> as much as the data returned is of the form '(1,10,23,33,35,48)' i.e. a
> list variable holding 6 integers returned as a string.

>>> s = '(1,10,23,33,35,48)'
>>> t = eval(s)
>>> print t
(1,10,23,33,35,48)

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list