Example showing how to write a Python extension module using ocaml-ctypes, based on ocaml-ctypes-inverted-stubs-example.
opam install ctypes-foreign ctypes
and a working python3 installation, eg. on ubuntu, it will be something like:
apt-get install python-dev
make
python3 tests.py
- tested on python-3.6.5 but should work on recent python3 releases.