[Python-Dev] Improve Python for embedding

Thomas Heller theller at python.net
Mon Dec 22 15:15:08 EST 2003


>> I want to specify the Python path before calling Py_Initialize(), and I
>> don't want it to use *any* environment variables which (again) set the
>> flags.  So I thought of Py_InitializeEx() which would take parameters
>> specifying these things, and Py_Initialize() could be changed to call
>> Py_InitializeEx(NULL), maybe.
>
> If you don't want the environment to be used, set the global
> Py_IgnoreEnvironmentFlag before calling Py_Initialize().

I didn't know that, thanks for the hint.

[...]
>> Does it make more sense now?
>
> Not quite -- I don't understand why *you* don't want the environment
> variables to be used, if all you want is a better pythonw.exe.

I did probably mix two different things here.

> If that's your only experience with embedding Python, you can't really
> speak for other embedders.

That may be - my other experiences are py2exe and the embedding done in
bdist_wininst.

Now knowing Py_IgnoreEnvironmentFlag I would be satisfied with the
addition of a PySys_SetPath function ;-).

Thomas




More information about the Python-Dev mailing list