When I try to run the following python script with interpreter python.exe
import wx
import wx.c_customStruct
I get the following error:
Traceback (most recent call last):
File “wxPy.py”, line 3, in
import wx.c_customStruct
SystemError: dynamic module not initialized properly
I don’t understand how can I create an instance of my custom class in C++ and pass it as argument to call of python-function?
Please, give me advice, how to overcome these issues.
2. I don't understand how can I create an instance of my custom class in
C++ and pass it as argument to call of python-function?
Create a wrapped function that either creates and returns a new instance of the C++ class, or one that returns an existing instance if that is more appropriate. The SWIG wrapper for that function will take care of creating a Python proxy object to wrap around the returned C++ instance. You can then pass that object to whatever code you need to in Python, and when they call its methods the swigged code will be called again to reflect the call to the C++ methods.