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:
package main
import (
"fmt""github.com/go-python/py"
)
funcinit() {
err:=py.Initialize()
iferr!=nil {
panic(err)
}
}
funcmain() {
gostr:="foo"pystr:=py.NewString(gostr)
fmt.Printf("hello [%v]\n", pystr)
}$ go run ./main.go
hello [foo]