Embedding Python, PyImport_* etc etc...

Jeff Collins jcollins at endtech.com
Fri Dec 22 14:56:37 EST 2000


On Fri, 22 Dec 2000, t o b e wrote:
<snip>

Have you looked at Tools/freeze in the Python distribution?  This tool
provides the ability to create a single executable from set of python
modules.  Since you are embedding Python in another application, you won't
need all of the contents of the generated frozenmain.c file, but you can
extract the compiled bytecodes for each module (they appear as C arrays)
and the module lookup table (PyImport_FrozenModules) for use in you code.
You'll also have to set the flag Py_FrozenFlag to indicate to Python where
to find the modules.  Try an example and see what happens - it's use is
straightforward.


-- 
Jeffery D. Collins, Ph.D.
Sr. Software Developer
Endeavors Technology, Inc.






More information about the Python-list mailing list