# π
## C extension

Build:

```sh
./setup.py build_ext --inplace
```

Run:

```sh
./example.py
```

## ctypes

Compile a shared library

```sh
gcc -shared approx_pi.c -o approx_pi.so
```

Run:
```
./example_ctypes.py
```

## swig

Auto generate c code:

```sh
swig -python pi_swig.i
```

Build the extension:

```sh
./setup-swig.py build_ext --inplace
```

Run:
```
./example_swig.py
```
