duano3557 2015-12-11 13:04
浏览 43


Currently I'm doing a project in Golang which need to call to Python.

In Python it's a library of singleton-like instance.

But I can't modify those library because It's too complicated. (for me)

Most thing I can do is wrap it with my own Python script.

So I'm finding a way to create multiple Python interpreter in Go.

Or maybe multiple sub-interpreter in Python.

Which mean I can create many python instance(same application).

Any ways I can do this?

  • 写回答

1条回答 默认 最新

  • dpxnrx11199 2015-12-16 12:19

    As Chris Townsend and pie-o-pah said,

    Trying to implement sub-interpreter is much more complicate.

    Try to create the language interface is make senses to my case.

    In this situation os/exec is the way to go.

    And can even create ssh to remote my python module if my main server is overload.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥15 我想通过python处理sybase IQ库的一些数据,但是不知道sybase IQ库怎么连接,之前连接都是用linux上的 dbisql
  • ¥15 安装llama-cpp-python==0.1.83失败
  • ¥20 管道轴向耦合水击问题
  • ¥60 补全networkx TODO部分。
  • ¥15 有内推吗,云计算linux运维方向
  • ¥30 sort cuteSV.vcf by bcftools用IGV可视化出现报错
  • ¥100 SOS!对STK中导出的天体图像进行质心提取有没有人做过啊
  • ¥15 python 欧式距离
  • ¥15 运行qteasy报错
  • ¥15 遗传算法解决有工序顺序约束的大规模FJSP问题