string to integer problem
newspost at lolmc.com
Sun Feb 8 18:13:44 CET 2004
On Sun, 08 Feb 2004 18:00:11 +0100, Diez B. Roggisch wrote:
>> 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
thanks for this it worked a treat but I don't understand how - even after
reading the docs for the eval() builtin function.Could you explain what's
going on (in fairly simple terms as well - I'm a programmer for fun not
cause it's my job)
More information about the Python-list