<div dir="ltr"><div class="">
<p>I'm trying to execute "dot" (a graph drawer thing from <a href="http://www.graphviz.org/" rel="nofollow">www.graphviz.org</a>) form IronPython. Here is my code:</p>
<pre style class=""><code><span class="">import</span><span class=""> clr
clr</span><span class="">.</span><span class="">AddReference</span><span class="">(</span><span class="">'System.Core'</span><span class="">)</span><span class="">
</span><span class="">import</span><span class=""> </span><span class="">System</span><span class="">
clr</span><span class="">.</span><span class="">ImportExtensions</span><span class="">(</span><span class="">System</span><span class="">.</span><span class="">Reflection</span><span class="">)</span><span class="">
clr</span><span class="">.</span><span class="">ImportExtensions</span><span class="">(</span><span class="">System</span><span class="">.</span><span class="">Diagnostics</span><span class="">)</span><span class="">
</span><span class="">from</span><span class=""> </span><span class="">System</span><span class="">.</span><span class="">Diagnostics</span><span class=""> </span><span class="">import</span><span class=""> </span><span class="">Process</span><span class="">
</span><span class="">from</span><span class=""> </span><span class="">System</span><span class="">.</span><span class="">Reflection</span><span class=""> </span><span class="">import</span><span class=""> </span><span class="">Assembly</span><span class="">
</span><span class="">from</span><span class=""> </span><span class="">System</span><span class="">.</span><span class="">IO </span><span class="">import</span><span class=""> </span><span class="">*</span><span class="">
</span><span class="">if</span><span class=""> __name__ </span><span class="">==</span><span class=""> </span><span class="">"__main__"</span><span class="">:</span><span class="">
p </span><span class="">=</span><span class=""> </span><span class="">Process</span><span class="">()</span><span class="">
p</span><span class="">.</span><span class="">StartInfo</span><span class="">.</span><span class="">UseShellExecute</span><span class=""> </span><span class="">=</span><span class=""> </span><span class="">False</span><span class="">
p</span><span class="">.</span><span class="">StartInfo</span><span class="">.</span><span class="">RedirectStandardOutput</span><span class=""> </span><span class="">=</span><span class=""> </span><span class="">True</span><span class="">
p</span><span class="">.</span><span class="">StartInfo</span><span class="">.</span><span class="">WorkingDirectory</span><span class=""> </span><span class="">=</span><span class=""> </span><span class="">"C:\\kod\\"</span><span class="">
p</span><span class="">.</span><span class="">StartInfo</span><span class="">.</span><span class="">FileName</span><span class=""> </span><span class="">=</span><span class=""> </span><span class="">'dot'</span><span class="">
p</span><span class="">.</span><span class="">StartInfo</span><span class="">.</span><span class="">Arguments</span><span class=""> </span><span class="">=</span><span class=""> </span><span class="">'-Tgif uj.gv -o mamammikasza.gif'</span><span class="">
p</span><span class="">.</span><span class="">Start</span><span class="">()</span><span class="">
p</span><span class="">.</span><span class="">WaitForExit</span><span class="">()</span><span class="">
egyString </span><span class="">=</span><span class=""> p</span><span class="">.</span><span class="">StandardOutput</span><span class="">.</span><span class="">ReadToEnd</span><span class="">()</span><span class="">
</span><span class="">print</span><span class=""> egyString
</span><span class="">print</span><span class=""> p</span><span class="">.</span><span class="">ExitCode</span></code></pre>
<p>In my test project works fine. I copied to my real project (after all
I commented everything in main.py, only the this code remained) and
gives me this</p>
<pre style class=""><code><span class="">exceptions</span><span class="">.</span><span class="">WindowsError</span><span class=""> occurred
</span><span class="">Message</span><span class="">:</span><span class=""> </span><span class="">[</span><span class="">Errno</span><span class=""> </span><span class="">22</span><span class="">]</span><span class=""> </span><span class="">The</span><span class=""> system cannot find the file specified</span></code></pre>
<p>at p.Start()
Please help.
I'm using VS 2010, .NET 4.0 IronPython (2.7.3 (2.7.0.40))</p><p>The "dot" was installed form msi provided by graphvis, and work fine from everywhere. <br></p>
</div></div>