Thanks very much! ;)<div><br></div><div>giovanni<br><br><div class="gmail_quote">2011/12/1 Markus Neteler <span dir="ltr">&lt;<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Thu, Dec 1, 2011 at 7:57 AM, Glynn Clements &lt;<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>&gt; wrote:<br>
...<br>
<div class="im">&gt; If you want to parse the output, set GRASS_MESSAGE_FORMAT=gui in the<br>
&gt; environment when running the command and read from the command&#39;s<br>
&gt; stderr; e.g.<br>
&gt;<br>
&gt;        import grass.script as grass<br>
&gt;        env = os.environ.copy()<br>
&gt;        env[&#39;GRASS_MESSAGE_FORMAT&#39;] = &#39;gui&#39;<br>
&gt;        p = grass.start_command(..., stderr = grass.PIPE, env = env)<br>
&gt;        # read from p.stderr<br>
&gt;        p.wait()<br>
&gt;<br>
&gt; If you need to capture both stdout and stderr, you need to use<br>
&gt; threads, select, or non-blocking I/O to consume data from both streams<br>
&gt; as it is generated in order to avoid deadlock.<br>
<br>
</div>Thanks, added to<br>
<a href="http://grass.osgeo.org/wiki/GRASS_and_Python#Percentage_output_for_progress_of_computation" target="_blank">http://grass.osgeo.org/wiki/GRASS_and_Python#Percentage_output_for_progress_of_computation</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Markus<br>
</font></span></blockquote></div><br></div>