How to convert string to list without eval or exec

Oliver Kurz olku at
Tue Mar 9 08:51:17 CET 2004


could someone give me a solution how to convert a string to a list without using eval or exec?

The string looks like:


and should be converted to a list:

[['abc', 'abc', ['abc', 'abc'], 'abc'], ['abc', 'abc', ['abc', 'abc'], ['abc', ['abc', 'abc']], 'abc'], 'abc']

I'm not allowed to use eval or exec.

Oliver Kurz

More information about the Python-list mailing list