go-python/gpython

Convert a Go module into a Python file

Opened this issue · 2 comments

Hello! Is there a one-click way to convert a Go module like mylib.module.go into a Python file so our Python teammates can continue development more easily?

ncw commented

If you want to integrate it into gpython then you need to add a bit of boilerplate to turn it into a gpython module.

If you want to integrate it with cpython then you'll need to make a shared library with CGO. I did this for another project - you might want to this check out to see how it is done: https://github.com/rclone/rclone/tree/master/librclone which has python bindings for Go via CGO.

another option (for the CPython use case), is to use go-python/gopy.