doc: add blurb about gopy module

Change-Id: Ib0f60c2823eb2e517190954e1b13535d86c69fb6
This commit is contained in:
Sebastien Binet 2015-08-07 13:17:55 +02:00
parent fe35c785e0
commit 19add390ff
1 changed files with 20 additions and 0 deletions

View File

@ -59,6 +59,26 @@ Options:
## Examples
### From the `python` shell
`gopy` comes with a little `python` module allowing to wrap and compile `go`
packages directly from the `python` interactive shell:
```python
>>> import gopy
>>> hi = gopy.load("github.com/go-python/gopy/_examples/hi")
gopy> inferring package name...
gopy> loading 'github.com/go-python/gopy/_examples/hi'...
gopy> importing 'github.com/go-python/gopy/_examples/hi'
>>> print hi
<module 'github.com/go-python/gopy/_examples/hi' from '/some/path/.../hi.so'>
>>> print hi.__doc__
package hi exposes a few Go functions to be wrapped and used from Python.
```
### From the command line
```sh
$ gopy bind -output=out github.com/go-python/gopy/_examples/hi
$ ls out