Python as a parser (newbie)

Bruce Dodson bruce_dodson at bigfoot.com
Fri Jul 30 14:07:37 EDT 1999


>From the sound of this, you don't really want to create a new parser.  You
just want to embed the Python scripting language in your application, and
export functionality from your application to the embedded python
interpreter.

I have done this with ArcView GIS.  It was quite painless.  Basically, just
look at the docs: there is a reference on the API for embedding, and a
tutorial on extending Python through modules written in C.  It is really
just a matter of of smearing those two ideas together.  You application
initializes the Python interpreter, then publishes some of its internal
routines as a Python module, and then whenever your application calls python
code, that Python code will be able to call back to your application through
that module.

It is one of Python's strengths that this is so easy.





More information about the Python-list mailing list