Python as an embedded scripting language

lss at excosoft.se lss at excosoft.se
Wed Oct 4 11:12:17 EDT 2000


Thanks! You're a lifesaver! The Python documentation I had seems to be
outdated, but I found updated documentation on the web, although I
couldn't find a version that contained a section 4.2 in "Extending and
Embedding"?

--
Ludvig

In article <8rf0ng02u9a at news2.newsguy.com>,
  "Alex Martelli" <aleaxit at yahoo.com> wrote:
> <lss at excosoft.se> wrote in message news:8ren1o$cq3$1 at nnrp1.deja.com...
> > Is it possible to embed Python as a scripting language in a C++
> > application and exposing the internals of the application to Python
> > through use of dynamic extension modules (PYDs)? Or is it necessary
to
> > link the extension modules statically with the executable in order
to
> > give them access to its internal data, and thus also to link the
Python
> > interpreter in as well, since the extension modules must then be
> > realized as builtin modules? This breaks PYDs altogether, though,
since
> > they are dependent upon a DLL Python core.
>
> Your application can embed Python residing in a DLL, and add its
> own modules to it with PyImport_AppendInittab (or the more general
> PyImport_ExtendInittab) before it calls Py_Initialize.
>
> > I would be thankful on any pointers on how to retain both Python's
> > access to the application data structures and the ability to import
> > PYDs.
>
> Section 5.3 in "Python/C API Reference Manual".  For cross-platform
> work, also note section 4.2 in "Extending and Embedding".
>
> Alex
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list