[python-win32] How Can I exec() a statement?

Gabriel Genellina gagenellina at softlab.com.ar
Wed Apr 6 21:47:26 CEST 2005


At Wednesday 6/4/2005 14:57, * William wrote:

>HOW -- or, is it possible -- to execute the an assignment statement from a 
>string?

Try 'exec'

 >>> a=1
 >>> b=2
 >>> exec 'a=b+3'
 >>> a
5


Gabriel Genellina
Softlab SRL 



More information about the Python-win32 mailing list