[C++-sig] Python Packages from embedded interpreter

theY4Kman they4kman at gmail.com
Mon Jan 14 02:03:57 CET 2008


I'm embedding Python into a C/C++ application and it has an enormous amount
of functions I wish to be accessible in Python. Right now, I have a module
named "sourcemod" initialized and running. It has its own functions that can
be called by importing the module.

However, I want these functions spread out in different modules in
"sourcemod", turning "sourcemod" into a package. For example, the user
should be able to "import sourcemod" and use "
sourcemod.console.PrintToConsole('Hello, World!')". I've been searching
everywhere, I've gone through the Python/C API reference, the Embedding and
Extending Python document, the #python channel on EFnet, and other people's
source code. None of the pages I've found shine any light on how to write a
Python package directly from C/C++.

Thanks,
Zach Kanzler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080113/5438b2ee/attachment.htm>


More information about the Cplusplus-sig mailing list