string to list? possible?

Aahz Maruch aahz at panix.com
Sun Jan 20 15:37:40 EST 2002


In article <3C4B2344.FF927B34 at alcyone.com>,
Erik Max Francis  <max at alcyone.com> wrote:
>maximilianscherr wrote:
>>
>> i need to convert a string like "[1, 2, 3, 4]" to a list [1, 2, 3, 4].
>> possible?
>
>Yep:
>
>Python 2.1.1 (#6, Sep  2 2001, 10:26:49) 
>[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
>Type "copyright", "credits" or "license" for more information.
>>>> str([1, 2, 3, 4])
>'[1, 2, 3, 4]'

You got the conversion reversed.
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"I support family values -- Addams family values" --www.nancybuttons.com



More information about the Python-list mailing list