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

2005-04-12 Thread Tim Roberts
On Mon, 11 Apr 2005 23:59:35 -0300, Gabriel Genellina [EMAIL PROTECTED] wrote: At Thursday 7/4/2005 10:53, * William wrote: For example, I'd like a way to get the symbol name for variable a above. Is there a function like nameOF( a )? Maybe a Python hacker guru could say something, but

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

2005-04-11 Thread Gabriel Genellina
At Thursday 7/4/2005 10:53, * William wrote: Please stay in the list - and even move to the Python-list as those topics are not specific to Windows. Exactly what I want to do -- for the enquiry about what I want to do, it is best to use as an example. #4 b = 2 print Before: print a = %s %

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

2005-04-06 Thread * William
Hello all. Thanks for the tips and solutions posted to the list so far. This is a general python question, not windows specific. It is my turn to ask. (Perhaps the notion below will suggest some development to one of you. Who knows?) I want to execute a statement indirectly in Python.

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

2005-04-06 Thread Steve Holden
* William wrote: Hello all. Thanks for the tips and solutions posted to the list so far. This is a general python question, not windows specific. It is my turn to ask. (Perhaps the notion below will suggest some development to one of you. Who knows?) I want to execute a statement

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

2005-04-06 Thread Gabriel Genellina
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 ___ Python-win32 mailing list

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

2005-04-06 Thread Bob Gailer
At 10:57 AM 4/6/2005, * William wrote: [snip] I want to execute a statement indirectly in Python. Take the simple case below. The chevrons indicate the result of the statement b = 2 a = b + 6 eval('a = b + 6', globals(), locals() ) There are often better solutions than exec. Tell us a bit