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

Kent Johnson kent37 at tds.net
Fri Feb 19 20:33:04 CET 2010


On Fri, Feb 19, 2010 at 1:56 PM, Carnell, James E
<jecarnell at saintfrancis.com> wrote:
>
> I am trying to teach a computer program - to program. It builds grammars and
> procedural memories on dictionary networks. How do I get the program to be
> able to input to the interpreter/command line and read the results? I have
> done this a wee bit with making a dictionary of functions, but in a sense I
> am creating a script language on top of a script language so it seems really
> dumb to me especially since I have to recreate the grammar.

It sounds like you are looking for eval()

(Standard warning - use eval() only on trusted data)

Kent


More information about the Tutor mailing list