Is there a simple way to parse this string ?

Stef Mientki stef.mientki at gmail.com
Wed Dec 19 16:17:04 EST 2007


hello,

I need to translate the following string
    a = '(0, 0, 0, 255), (192, 192, 192, 255), True, 8'

into the following list or tuple
    b = [(0, 0, 0, 255), (192, 192, 192, 255), True, 8 ]

Is there a simple way to to this.
(Not needed now, but might need it in the future: even deeper nested 
lists, represented by a string.)

thanks,
Stef Mientki



More information about the Python-list mailing list