Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果不使用ironpython,C#如何使用cpython程序(py文件)?
因为ironpython加载cpython代码存在一些bug。
如果您需要严格的 CPython 行为并且不想更改 Python 程序,恐怕在这种情况下,您应该生成单独的 CPython 进程并通过一些 RPC 协议(有很多可供选择)通过管道或网络连接到 localhost 与它进行交互.
作为“序列化” RPC 的替代方案,您可以使用系统设施,例如,如果您在 Windows 上使用 COM,或者在 Linux 上使用 D-Bus - 但这会使代码平台依赖且不一定更简单。