擅长:python、mysql、java
<p>我认为默认情况下Python引擎不会自动设置所需的路径。在</p>
<p><a href="http://www.voidspace.org.uk/ironpython/custom_executable.shtml" rel="nofollow">http://www.voidspace.org.uk/ironpython/custom_executable.shtml</a>有一个嵌入ironpython的示例。你好像少了点什么</p>
<pre><code>PythonEngine engine = new PythonEngine();
engine.AddToPath(Path.GetDirectoryName(Application.ExecutablePath));
engine.AddToPath(MyPathToStdLib);
</code></pre>
<p>除非我知道Ironpython的安装位置和安装情况,否则我更喜欢找到所需的所有标准模块,将它们编译为IPyStdLibDLL,然后从代码中执行以下操作</p>
^{pr2}$