This commit is contained in:
blueloveTH 2023-09-30 15:11:57 +08:00
parent bb69342368
commit c5f9d57583

View File

@ -4,13 +4,21 @@ title: Write bindings
order: 18 order: 18
--- ---
In order to use a C/C++ library in python, you need to write bindings for it.
## Automatic bindings
pkpy supports automatic binding generation **only for C libraries**.
See [pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) for details.
It takes a C header file and generates a python module stub (`*.pyi`) and a C++ binding file (`*.cpp`).
## Manual bindings
!!! !!!
This document is working in progress. This document is working in progress.
!!! !!!
## Old documents (deprecated)
pkpy allows to wrap a function pointer as a python function or method that can be called in python code. pkpy allows to wrap a function pointer as a python function or method that can be called in python code.
This function pointer has the following signature: This function pointer has the following signature: