Simple examples for extending Python with C/C++
Compile the extension module:
$ cd 01_hello_world
$ python3 setup.py build_ext --inplaceThis can be done by make, too:
$ makeRun a python script using the extension:
$ python3 ext01.pyA minimum extension module.
Use C/C++ pointer from Python.
Pass a filename string from Python to C/C++.
Return C/C++ data as an np.array.
Return a part of C/C++ data as an np.array.
Stop Python during long computation with Ctrl-C.