Parsing Python code with a Python Program

Ivo Woltring TheDolphin at ivonet.nl
Fri Oct 22 05:18:18 EDT 2004


Well you can also generate code into a specific file name and then import
the file and execute the generated code by reference to file.function...

goodluck
Ivo

"Michael Hudson" <mwh at python.net> wrote in message
news:m33c2dkhuk.fsf at pc150.maths.bris.ac.uk...
> 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