.NET/C# Interop to Python

萝らか妹 提交于 2019-12-04 05:25:25

I would argue that pythonnet is your best option:

  1. Embedded Python interpreter is not the same as Python sub-interpreter. The sub-interpreter is used much less, while CPython has been embedded in major applications. Moreover memory leaks should be very unlikely due to pythonnet taking care of this for you.
  2. The embedded interpreter does not have to be shutdown between calls to it - in fact this can get very expensive, you can keep it persistent as long as your application is alive.
  3. Threading issues can be avoided if you enclose the code requiring the GIL with using (Py.GIL()) {} blocks.
  4. The added benefit of debugging CPython/.NET code in mixed-mode using PTVS.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!