Execute a list

Martin Miller ggrp1.20.martineau at dfgh.net
Tue Feb 22 04:20:21 EST 2005


Here is how to execute code in a string, similar to what was shown in
your example:

>>> s = 'print "hello"'
>>> exec s
hello

Hope this helps.




More information about the Python-list mailing list