Execute a list

Swaroop C H swaroop at swaroopch.info
Tue Feb 22 03:13:58 EST 2005


Groleo Marius wrote:
> How can i execute a string in python?
> How can I execute the code that "s" keeps inside, considering that the
> code is correct?

Use the exec statement : `exec s`
Details at http://www.python.org/doc/ref/exec.html

Regards,
-- 
Swaroop C H
Blog: http://www.swaroopch.info
Book: http://www.byteofpython.info




More information about the Python-list mailing list