Golang - Python interoperability

625 Views Asked by At

Is there any way to use python libraries like pandas, numpy, scipy, pytorch, ... from Go programming language?

I know that these libraries are not programmed in python but in c, so maybe it is easy to call funcions from golang.

1

There are 1 best solutions below

0
On

I don't know how practical it would be but if it's a little piece of code you can run it using go's "os/exec" package like so:

exec.Command("python",  "-c", "import pythonfile; print pythonfile.cat_strings('foo', 'bar')")