go-from-python

command module
v0.0.0-...-54552bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

Using Go from Python

This repository is a toy example of using Cgo and Python's C FFI to effectively reuse Go code from Python. Tested on Go 1.12+, Python 3.8+.

Notes:

  • In the lib dir, one does not need the generated C header file. It can be useful, however, for understanding how Cgo generates code.
  • Required Python packages: To run tests, pytest is required. To try the example notebook, jupyter is required.

Usage

Build shared C lib, run Go and Python unit tests:

$ make

Cleanup:

$ make clean

Explore with Jupyter Notebook:

$ jupyter notebook # then open example.ipynb

© 2020 Damien Stanton

See LICENSE for details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL