py is a high-level API wrapping the low-level CPython C-API, for go.
$ go get github.com/go-python/pyDocumentation is available on godoc:
github.com/go-python/py
package main
import (
"fmt"
"github.com/go-python/py"
)
func init() {
err := py.Initialize()
if err != nil {
panic(err)
}
}
func main() {
gostr := "foo"
pystr := py.NewString(gostr)
fmt.Printf("hello [%v]\n", pystr)
}$ go run ./main.go
hello [foo]