https://github.com/go-python/py
py is a high-level API wrapping the low-level CPython C-API, for go
https://github.com/go-python/py
Last synced: 9 months ago
JSON representation
py is a high-level API wrapping the low-level CPython C-API, for go
- Host: GitHub
- URL: https://github.com/go-python/py
- Owner: go-python
- License: bsd-3-clause
- Created: 2015-01-30T17:06:19.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-24T14:34:00.000Z (over 10 years ago)
- Last Synced: 2025-03-26T10:11:31.672Z (9 months ago)
- Language: Go
- Homepage:
- Size: 160 KB
- Stars: 17
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
py
==
`py` is a high-level API wrapping the low-level `CPython` C-API, for `go`.
## Installation
```sh
$ go get github.com/go-python/py
```
## Documentation
Documentation is available on [godoc](https://godoc.org):
[github.com/go-python/py](https://godoc.org/github.com/go-python/py)
## Examples
```go
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)
}
```
```sh
$ go run ./main.go
hello [foo]
```