"10, 20, 30" to [10, 20, 30]

Daniel Austria futurebase at gmx.at
Thu Nov 23 06:13:10 EST 2006


Sorry,

how can i convert a string like "10, 20, 30" to a list [10, 20, 30]

what i can do is:

s = "10, 20, 30"
tmp = '[' + s + ']'
l = eval(tmp)

but in my opinion this is not a nice solution


daniel




More information about the Python-list mailing list