Closed zjb0807 closed 8 years ago
theoretically, you should simply have to follow: https://docs.python.org/2/extending/extending.html#a-simple-example
but that's not easily possible with go-python
(especially the PyMethodDef
and Py_InitModule
parts)
I would recommand github.com/go-python/gopy if you are using go-1.5
(gopy
isn't completely compatible with go >= 1.6
)
In go source: //------------------------------ type mdapi struct { } func (p *mdapi)add(){} //------------------------------ how to call add function in python code ?