Simple interface to add Python modules to your Qt/C++ Project
First Create one ore more modules. Then you can create objects(classes) described in those module
- Create
PythonBinding py;
py.init(<your module>,<path to module(optional)>);
- Call Function
py.callFunction("pythonFunction",{<Args>}); //eg. {PyLong_FromLong(3), PyLong_FromLong(5)}
- Access Variables It is recommended to use getter and setter functions to access global variables.
- Create
PythonObject obj = py.createObject("pythonClass");
- Call Function
obj.callFunction("pythonFunction",{<Args>}); //eg. {PyLong_FromLong(3), PyLong_FromLong(5)}
- Access Attributes
obj.setAttribute(name,value) //eg. name="attr1" value="PyLong_FromLong(3)"
PySharedRef val=obj.getAttribute(name) //eg. name="attr1"
If you want to secure a value from getting removed by the garbage collector use PyShrardRef. The Object will be deleted after PySharedRef desctructor is called.
There is a large Doxygen compatibel documentation with code snippets in the source code. Just create a doxygen documentation for this repo covering all source and header files.