Thanks very much! ;)<div><br></div><div>giovanni<br><br><div class="gmail_quote">2011/12/1 Markus Neteler <span dir="ltr"><<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>></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 <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>> wrote:<br>
...<br>
<div class="im">> If you want to parse the output, set GRASS_MESSAGE_FORMAT=gui in the<br>
> environment when running the command and read from the command's<br>
> stderr; e.g.<br>
><br>
> import grass.script as grass<br>
> env = os.environ.copy()<br>
> env['GRASS_MESSAGE_FORMAT'] = 'gui'<br>
> p = grass.start_command(..., stderr = grass.PIPE, env = env)<br>
> # read from p.stderr<br>
> p.wait()<br>
><br>
> If you need to capture both stdout and stderr, you need to use<br>
> threads, select, or non-blocking I/O to consume data from both streams<br>
> 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>