aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 8e69112617eff0e84a854efe0c4d336469d9ce62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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:

1. Install the python development package. It is usually called `python3-dev`
   or `python3-devel`.
2. 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 use `python3-config --includes` and replace the
   appropriate line in the Makefile.
3. Open `python` and enjoy!

```
>>> import sum_module
>>> sum_module.sum_from_c(23, 19)
42
```

Generated with cgit - Back to sebastiano.tronto.net