string to list when the contents is a list

Rhodri James rhodri at wildebst.demon.co.uk
Thu Feb 18 01:13:05 CET 2010


On Wed, 17 Feb 2010 23:48:38 -0000, Wes James <comptekki at gmail.com> wrote:

> I have been trying to create a list form a string.  The string will be
> a list (this is the contents will look like a list).  i.e. "[]" or
> "['a','b']"

If your string is trusted (i.e. goes nowhere near a user), just eval() it.

-- 
Rhodri James *-* Wildebeeste Herder to the Masses



More information about the Python-list mailing list