string to list of numbers conversion

jm.suresh@no.spam.gmail.com jm.suresh at gmail.com
Sun Nov 5 07:34:32 EST 2006


Hi,
  I have a string '((1,2), (3,4))' and I want to convert this into a
python tuple of numbers. But I do not want to use eval() because I do
not want to execute any code in that string and limit it to list of
numbers.
  Is there any alternative way?

Thanks.
Suresh




More information about the Python-list mailing list