A tiny demo for a Python module in C
This repo contains a Python module written in C with only one function.
Works on my machineā¢. To make it works on yours:
- Install the python development package. It is usually called
python3-dev
orpython3-devel
. - Compile this module with
make
. If this does not work, it is possible that the path to the Python.h header is different on your system. to find it, you can usepython3-config --includes
and replace the appropriate line in the Makefile. - Open
python
and enjoy!
>>> import sum_module
>>> sum_module.sum_from_c(23, 19)
42