简体   繁体   中英

python-sip: How to access a DLL from both Python and C++

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.

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.

Please take a look at this Library

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM