Home > Blockchain >  Build a installable python package with C
Build a installable python package with C

Time:12-09

I want to build a Python module that use C because it is much faster. I found out that I can use subprocess module to run an executable file however I can't build a package. I also tried ctypes but I can't return object like std::vector in C . So what is the most efficient way to build a package with wrapped C code? Thanks in advance!

CodePudding user response:

You should build a C/C Python extension module. See:

https://docs.python.org/3/extending/extending.html

CodePudding user response:

Pybind11 is the easiest way to build a C/C extension for Python.

  • Related