[GRASS-dev] obtain the progress percentage of a command run from
giohappy at gmail.com
Thu Dec 1 09:25:35 EST 2011
Thanks very much! ;)
2011/12/1 Markus Neteler <neteler at osgeo.org>
> On Thu, Dec 1, 2011 at 7:57 AM, Glynn Clements <glynn at gclements.plus.com>
> > If you want to parse the output, set GRASS_MESSAGE_FORMAT=gui in the
> > environment when running the command and read from the command's
> > stderr; e.g.
> > import grass.script as grass
> > env = os.environ.copy()
> > env['GRASS_MESSAGE_FORMAT'] = 'gui'
> > p = grass.start_command(..., stderr = grass.PIPE, env = env)
> > # read from p.stderr
> > p.wait()
> > If you need to capture both stdout and stderr, you need to use
> > threads, select, or non-blocking I/O to consume data from both streams
> > as it is generated in order to avoid deadlock.
> Thanks, added to
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-dev