Writing a Python extension in Go (Golang)

前端 未结 4 1659
一整个雨季
一整个雨季 2020-12-12 20:58

I currently use Cython to link C and Python, and get speedup in slow bits of python code. However, I\'d like to use goroutines to implement a really slow (and very paralleli

4条回答
  •  自闭症患者
    2020-12-12 21:09

    There is a go-python package precisely to help you write Python extensions in Go:

    this package provides an executable "go-python" which just loads "python" and then call python.Py_Main(os.Args). the rational being that under such an executable, go based extensions for C-Python would be easier to implement (as this usually means calling into go from C through some rather convoluted functions hops)

提交回复
热议问题