469,964 Members | 1,754 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Newb, using Python in win32 app, how to import c++ modules created with swig from an .exe

Hi, I'm using Python in my win32 app by linking to the python23.dll.
I'm trying to expose some c++ code in my app to Python so I can make
application calls from Python scripts (according to the Python windows
FAQ I shouldn't have to make a seperate dll, see link below). I
create a MyModule.i file for swig which contains a simple test c++
class. I run swig on it with the following options: swig -python -c++
-includeall -shadow MyModule.i, and as expected it creates a
MyModule.py and MyModule_wrap.cxx. When I can compile the .cxx
wrapper file into my app, my app now exports init_MyModule. This
seems good. The problem is, how do I import this module into Python?
If I run the MyModule.py script swig generated, it tries to import the
swig-generated shadow class module named _MyModule, which in turn
looks for a lib named _MyModule.lib and dll named _MyModule.pyd, which
don't exist. I need to point Python to the code in my application
(which is named MyApp.exe). I'm guessing there might be a swig option
which does this, but I can't find it in the documentation. For
reference I've included a link to the relevant part of the Python
Windows faq below. Much thanks for any help.

- Jon Moldover
Frog City Sofware

Jul 18 '05 #1
0 1833

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Phil Schmidt | last post: by
7 posts views Thread by Carl Waldbieser | last post: by
9 posts views Thread by timothy.williams | last post: by
8 posts views Thread by Gekitsuu | last post: by
3 posts views Thread by stuart_white_ | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
2 posts views Thread by mr_gees100_peas | last post: by
3 posts views Thread by code_berzerker | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.