douke1905 2012-09-15 23:19
浏览 152
已采纳

在Go(Golang)中编写Python扩展

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 parallelizable) bit of code, but it must be callable from python. (I've already seen this question)

I'm (sort of) happy to go via C (or Cython) to set up data structures etc if necessary, but avoiding this extra layer would be good from a bug fix/avoidance point of view.

What is the simplest way to do this without having to reinvent any wheels?

  • 写回答

4条回答 默认 最新

  • doujiao3016 2015-09-27 21:29
    关注

    Update 2015: possible as of Go 1.5 https://blog.filippo.io/building-python-modules-with-go-1-5/

    with Go 1.5 you can build .so objects and import them as Python modules, running Go code (instead of C) directly from Python.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制