Closed alexec closed 2 years ago
as can be seen in https://github.com/go-python/gpython/blob/master/main.go#L120, embedding a gpython vm is like:
res, err := vm.Run(module.Globals, module.Globals, code, nil)
ie:
is that too low level an API?
I actually figured it out:
https://github.com/argoproj/argo-workflows/blob/master/util/python/python.go
I wrote code to convert Go types into Python types. Is there another way?
My question is similar. I would like to execute methods of a Python script from my Golang application. Is that possible in a easy way? I need something more high-level fashioned.
I'll try to provide a simple example. but this will have to wait for https://github.com/go-python/gpython/pull/144 to be merged (as the API is changing a bit to allow for multiple VM-contexts to run concurrently)
In the coming days I'll PR the main README and add updated docs and snippets for newcomers to more easily get up and running. The changes coming offer a couple new high-level calls that make life very nice to use and embed gpython.
Is it possible to embed this? Like Otto (https://github.com/robertkrimen/otto).