[Python-Dev] Embedding python in C++! Please HELP !
Adrian Leu
AdrianLeu@Kelseus.com
Fri, 9 Nov 2001 12:21:10 -0000
Hi !
I have recently started using Python, mainly attracted by the easy way in
which I can write a parser for some project I have. However, the problems
occurred while trying to
use the debug version.
I have:
* built Python from the source and made sure that all the _d
libraries are in the right directories (./DLLs and /.libs);
* created a small module which uses _winreg to set some registry
keys;
* written a small C++ application that uses basic:
Py_Initialize();
...
PyImport_ImportModule(my_module)
PyObject_CallMethod(my_module, my_method, etc)
to basically load my module and call a method associated to it.
However, although everything is working OK in Release mode, in Debug
mode things are not working. My module cannot be imported for some reason or
another.
I have tried to use Python_d.exe to do the same thing interactively
and what I get is that _winreg cannot be imported. Every time I try to do
this, I get a:
ImportError: No module named _winreg error.
although the module is there.
I am getting very frustrated about this. Is it something I am doing wrong?
Also, I would like to know where could I get the source for win32
extensions. I would like to build these extensions and use them later to
create a small window
which I can open to enter some text.
Please, please help ! It must be something trivial that I miss here.
Thanks.
Adrian.