Hello Glynn<div>Just one question: I reading <a href="http://grass.osgeo.org/programming6/pythonlib.html">http://grass.osgeo.org/programming6/pythonlib.html</a> the "<b>GRASS-oriented interface to subprocess module" and I'm wondering wich one of this functions shall i use to run an external bin in Windows? run_command?</b></div>
<div><b>Thanks<br></b></div><div><b><br></b><div class="gmail_quote">2011/7/1 Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
katrin eggert wrote:<br>
<br>
> I want to integrate in a Python script a call to an external binary (a small<br>
> fucntion that I have done). What can i use to do this?<br>
<br>
</div>The standard Python functions for spawning child processes are<br>
subprocess.Popen() and subprocess.call()<br>
<br>
<a href="http://docs.python.org/library/subprocess.html" target="_blank">http://docs.python.org/library/subprocess.html</a><br>
<br>
The grass.script module has its own versions of these functions, which<br>
set shell=True on Windows so that scripts work, but that doesn't<br>
matter if you're running a binary executable. It also has several<br>
functions which are intended specifically for running GRASS modules<br>
(anything that uses the GRASS command-line parser).<br>
<font color="#888888"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</font></blockquote></div><br></div>