pyimport & deomo: callpy (todo)
This commit is contained in:
12
_pydemo/callpy/callpy.go
Normal file
12
_pydemo/callpy/callpy.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/goplus/llgo/c"
|
||||
"github.com/goplus/llgo/py"
|
||||
"github.com/goplus/llgo/py/math"
|
||||
)
|
||||
|
||||
func main() {
|
||||
x := math.Sqrt(py.Float(2))
|
||||
c.Printf(c.Str("sqrt(2) = %f\n"), x.FloatAsDouble())
|
||||
}
|
||||
Reference in New Issue
Block a user