Re: [exim-dev] Embedding Python

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Phil Pennock
Data:  
Para: exim-dev
Asunto: Re: [exim-dev] Embedding Python
On 2013-05-20 at 21:22 +0000, Viktor Dukhovni wrote:
> IIRC Python automatically adds the directory containing a script
> to the search path for modules imported by *that* script.


That's something handled by the Python top-level wrapper, which embeds
the Python library.

See Python's Modules/main.c, RunMainFromImporter() (which does pretty
much what Todd is doing), called from Py_Main() below.

We're not invoking programs, we're not hitting __main__ invocation,
we're loading the code as a module to make functions available for later
calling.

-Phil