[Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

ALAN GAULD alan.gauld at btinternet.com
Sat Feb 20 02:09:19 CET 2010



Looks like the eval() will work great. Thanks so much for telling me. 
>
>We normally warn against using eval/exec because 
they form a security risk. But in your case you 
are in control of the code that they execute so 
its ok. That is the kind of usage where they 
are the best solution.

Be very wary of cases where you read stored code 
from a file and execute it however. Its opssible 
a malicious user could add/change the code to do 
something bad. But provided you create the 
executing code yourself you should be fine.


Alan G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100220/8cc12a22/attachment.htm>


More information about the Tutor mailing list