[Tutor] string to list
simbobo at cooptel.net
Wed Feb 10 13:34:02 CET 2010
I have solved it myself - must search more before posting!
If anyone at my kind of level is interested:-
>>> mystring = "[(1,2), (3,4)]"
>>> mylist = eval(mystring)
Owain Clarke wrote:
> Please excuse the obviousness of my question (if it is), but I have
> searched the documentation for how to generate a list e.g. [(1,2),
> (3,4)] from a string "[(1,2), (3,4)]". I wonder if someone could point
> me in the right direction.
> Many thanks
> Owain Clarke
More information about the Tutor