Hi<div>Just one question: </div><div>is there any difference, when it comes to processing, between run_command and read_command?</div><div>and from read_command  can I retrieve the error also?</div><div>THanks<br><br><div class="gmail_quote">
2011/5/19 Glynn Clements <span dir="ltr">&lt;<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
Luisa Peņa wrote:<br>
<br>
&gt; I&#39;m using grass.run_command and I have one question: besides setting flags,<br>
&gt; parameters can I also get error and output from that function like<br>
&gt; p=grass.run_command(&quot;r.out.xyz&quot;, parameters=X, flags=&quot;f...&quot;, stdout=output,<br>
&gt; stderr=error)<br>
<br>
</div>Use read_command or pipe_command.<br>
<br>
read_command returns the command&#39;s output (stdout) as a string.<br>
<br>
pipe_command returns the Popen object; read from its .stdout member.<br>
Call the .wait() method when you&#39;re done with it. For details of Popen<br>
objects, see:<br>
<br>
<a href="http://docs.python.org/library/subprocess.html#popen-objects" target="_blank">http://docs.python.org/library/subprocess.html#popen-objects</a><br>
<br>
The most general function is start_command, upon which all of the<br>
*_command functions (except for exec_command) are built. Again, this<br>
function returns the Popen object.<br>
<br>
Refer to the source code ($GISBASE/etc/python/grass/script/core.py)<br>
for more details. Most of those functions are only a few lines long.<br>
<font color="#888888"><br>
--<br>
Glynn Clements &lt;<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>&gt;<br>
</font></blockquote></div><br></div>