testpy: os.Getcwd

This commit is contained in:
xushiwei
2024-05-12 23:45:56 +08:00
parent 9e0d22ac90
commit ce0f5f3797
2 changed files with 24 additions and 4 deletions

View File

@@ -4,9 +4,12 @@ import (
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/py"
"github.com/goplus/llgo/py/math"
"github.com/goplus/llgo/py/os"
)
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())
}