我如何仅调用C#的Python脚本的一个函数,而不必连续打开整个文件和功能?
我有一个.py脚本加载一些非常重的文件,我想从C#程序打开Python程序,并调用不同的函数,而不必连续打开模型。
- 我试图使用Ironpython函数来称呼它,但我会收到以下错误。 在此处输入图像描述
如果我尝试通过下一个代码添加: var SearchPaths = Engine.getSearchPaths(); 看来我是下一个错误_: 在此处输入图像描述
- 如果我尝试使用新过程来完成,我只能调用整个过程例行程序,在每次迭代中,我需要很长时间才能打开模型并执行该模型,仅当我只想在该过程启动后才调用函数。我该怎么做?我附加了以下我启动该过程的代码。 在此处输入图像描述
I have a .py script that loads some very heavy files and I would like to open the python program from a C# program and call the different functions without having to continuously open the model.
- I tried to call it with the IronPython function but I get the following error.
enter image description here
If i try to add by the next code:
var searchPaths = engine.GetSearchPaths();
it appears me the next error_:
enter image description here
- If I try to do it with a new process I can only call the whole routine, and in each iteration it takes me a long time to open the model and execute it when I only want to call a function once the process has started. How can I do this? I attach the following code of how I start the process.
enter image description here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论