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. Take the simple case
below. The chevrons ">> " indicate the result of the
statement
While I appreciate that "eval()" is not the way to do this, it is also true
that "eval()" accurately signals my intention in this sample.
HOW -- or, is it possible -- to execute the an assignment statement from a
string?
I have used compile() and considered using a 'block'. Compile doesn't
help. And I can't find an equivalent for 'eval( <block> )' ...
Who has the answer?
Many thanks in advance.
Cheers,
Will.
|
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.3 - Release Date: 5/Apr/2005
_______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32