2015-01-30 17:01:15 +00:00
|
|
|
// Copyright 2015 The go-python Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
/*
|
2015-07-24 14:16:31 +00:00
|
|
|
gopy generates (and compiles) language bindings that make it possible to call Go code
|
2015-02-16 21:53:36 +00:00
|
|
|
and pass objects from Python.
|
2015-01-30 17:01:15 +00:00
|
|
|
|
2022-11-15 10:36:11 +00:00
|
|
|
# Using gopy
|
2015-01-30 17:01:15 +00:00
|
|
|
|
2015-07-24 14:16:31 +00:00
|
|
|
gopy takes a Go package and generates bindings for all of the exported
|
2015-01-30 17:01:15 +00:00
|
|
|
symbols. The exported symbols define the cross-language interface.
|
|
|
|
|
2015-07-24 14:16:31 +00:00
|
|
|
The gopy tool generates both an API stub in Python, and binding code in
|
2015-01-30 17:01:15 +00:00
|
|
|
Go. Start with a Go package:
|
|
|
|
|
2022-11-15 10:54:30 +00:00
|
|
|
package hi
|
2015-01-30 17:01:15 +00:00
|
|
|
|
2022-11-15 10:54:30 +00:00
|
|
|
import "fmt"
|
2015-01-30 17:01:15 +00:00
|
|
|
|
2022-11-15 10:54:30 +00:00
|
|
|
func Hello(name string) {
|
|
|
|
fmt.Println("Hello, %s!\n", name)
|
|
|
|
}
|
2015-01-30 17:01:15 +00:00
|
|
|
*/
|
|
|
|
package main
|