pyimport & deomo: callpy (todo)

This commit is contained in:
xushiwei
2024-05-11 06:23:05 +08:00
parent 29830865d9
commit cca46573ea
7 changed files with 87 additions and 11 deletions

12
_pydemo/callpy/callpy.go Normal file
View 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())
}