List to STR to List

Cedric Dutoit dutoitc at hotmail.com
Sun Jul 14 16:52:05 EDT 2002


Larry wrote:
> I did a typo...should be...
> 
> List1 = [1,2,3]
> String1 = str(List1)
> 
> Is there now a way to convert my String1 variable back into a list???

Another way... more funnier so I like it !
List2 = [int(el) for el in String1[1:-1].split(",")]


C.Dutoit




More information about the Python-list mailing list