Parsing Python code with a Python Program

Michael Hudson mwh at python.net
Mon Aug 23 11:13:39 EDT 2004


pgw <a6c21487 at telus.net> writes:

> Hello,
> 
> I would like to pass strings to a Python
> application and have them executed as though
> they were lines of code.
> 
> Is 'exec()' the function that I am looking for
> and/or is there an example of this somewhere?

Well, it's a statement, not a function, but yes, that's what you're
looking for.

Cheers,
mwh

-- 
  Well, you pretty much need Microsoft stuff to get misbehaviours
  bad enough to actually tear the time-space continuum.  Luckily 
  for you, MS Internet Explorer is available for Solaris.
                              -- Calle Dybedahl, alt.sysadmin.recovery



More information about the Python-list mailing list