py icon indicating copy to clipboard operation
py copied to clipboard

py is a high-level API wrapping the low-level CPython C-API, for go

py

py is a high-level API wrapping the low-level CPython C-API, for go.

Installation

$ go get github.com/go-python/py

Documentation

Documentation is available on godoc:

github.com/go-python/py

Examples

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]