[GRASS-dev] obtain the progress percentage of a command run from python

Hamish hamish_b at yahoo.com
Wed Nov 30 20:24:44 EST 2011

Giovanni wrote:
> I've seen that the grass.script.core.percent() module method wraps
> the g.message -p command.It's ok when the work is done within the python
> code, but how to grab the progress emitted by a GRASS command (i,e,
> G_percent)?
> There are many ways to run a command from python. What is the most
> appropriate to obtain/pipe the percentage from the command... given it
> can be done?

try the GRASS_MESSAGE_FORMAT=gui environment variable.

see http://grass.osgeo.org/grass70/manuals/html70_user/variables.html#enviro


More information about the grass-dev mailing list