Embedding Python in Windows App , use of Registry & ENV to find modules

quadric at primenet.com quadric at primenet.com
Thu Dec 5 15:50:22 EST 2002


Hi,

I have embedded Python in a Windows App and am using it for a generalized 
expression
evaluator and as a means to connect to other Apps via additional  imported 
Python modules.

The machines that this Windows App run on may or may not have full 
installations of Python
on them at the time of installation of Windows App, or may have full 
installation of Python applied
after installation of Windows App.  In any case, I would like to safeguard 
the Windows App from
Python version conflicts by isolating all required Python DLL's/EXE's/pyc's 
etc.... into a location
I can control and keep separate from any other Python installations.

The only way I can see to do this practically, is to modify Py_Initialize() 
and
PyWin_FindRegisteredModule() ( and possibly a few others ) to have 
Environment variables and
Registry Keys of my own choosing.  Recompile, relink etc...... and have the 
install program create
said environment variables and Registry keys.

Does someone knowledgeable in such matters agree, or is there a better way?

Should I just go ahead and do a full install of Python on every  machine 
running the Windows App?

My fear is that some of these machines may already have Python on them and 
some may get it
afterwards.  Either way, myself or the other Python user may not appreciate 
an unsolicited upgrade
( or downgrade ) to their Python installation.  Notwithstanding potential 
changes to Python itself
that could cause a problem if Windows App is written to expect some Python 
version dependent
behavior........

I think I have located all required functions to be modified along with 
identifying the necessary Registry
entries to be made.

Any thoughts or experiences with this sort of thing would be appreciated.

Thanks

quadric at primenet.com





More information about the Python-list mailing list