string to list? possible?
maximilianscherr
MaximilianScherr at T-Online.de
Sun Jan 20 15:22:39 EST 2002
Thanks, to everyone
--- In python-list at y..., bbrox at b... (Lionel Ulmer) wrote:
> On Sun, 20 Jan 2002 19:38:20 -0000, maximilianscherr
> <MaximilianScherr at T...> wrote:
> >i need to convert a string like "[1, 2, 3, 4]" to a list [1, 2, 3,
4].
> >possible?
>
> >>> a = eval("[1, 2, 3, 4]")
> >>> a
> [1, 2, 3, 4]
>
> But well, you need to be sure that no syntax errors are in the
lists :-)
>
> Lionel
>
> --
> Lionel Ulmer - http://www.bbrox.org/
> --
> http://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list