cl: _testpy/callpy

This commit is contained in:
xushiwei
2024-07-04 18:39:31 +08:00
parent e55e90db1a
commit 4660eae8c7
3 changed files with 23 additions and 11 deletions

View File

@@ -5,11 +5,12 @@ import (
"github.com/goplus/llgo/py"
"github.com/goplus/llgo/py/math"
"github.com/goplus/llgo/py/os"
"github.com/goplus/llgo/py/std"
)
func main() {
x := math.Sqrt(py.Float(2))
wd := os.Getcwd()
c.Printf(c.Str("sqrt(2) = %f\n"), x.Float64())
c.Printf(c.Str("cwd = %s\n"), wd.CStr())
std.Print(py.Str("cwd ="), wd)
}