0

I have a C++ GUI, it load a DLL when running. I use SIP to import the DLL in python. I need to embed the python part in the GUI, and some data are needed to exchange between python and C++.

For example, in the C++ GUI, I can enter command from a panel, such as "drawSomething()", it will call corresponding function in python, and the result will be shown in the GUI.

Can I use SIP to extract a C++ object from python object (just like the way boost.python does), or is there a better way to share data between python and c++ seamlessly?

thanks.

sunmooner
  • 13
  • 1
  • 5

2 Answers2

0

It turns out that I do not need to do anything complicated... In my case, there is no difference to call functions in DLL from C++ or from python code embedded in C++. I am totally over-thinked.

sunmooner
  • 13
  • 1
  • 5
-1

Please take a look at this Library

http://www.swig.org/Doc1.3/Python.html

vinod
  • 132
  • 5
  • 1
    Is SWIG relevant if they're using SIP? – poolie Jun 06 '13 at 22:13
  • Thx for replying. I think SWIG is similar to SIP when extending python with C++ (dll --> pyd), and I am not sure whether SWIG or SIG has the ability to get data ***from python to C++***, when the module of python part is generated by one of them. I read the SWIG tutorial written by Beazley yesterday, and it seems for SWIG (probably the same for SIP), all the features are for C++ --> python. When C++ functions can run under python environment, that's the end of its job. Maybe my real question is only about Python Embedding – sunmooner Jun 07 '13 at 00:50