[GRASS-dev] python and GRASS_MESSAGE_FORMAT

Daniel Calvelo dca.gis at gmail.com
Mon Nov 27 00:02:16 EST 2006


On 11/26/06, Jachym Cepicky <jachym.cepicky at centrum.cz> wrote:
> thanks for this hint, but it does not seem, that it would help.
> behaviour remain same:
>
> import os
> os.putenv("GRASS_MESSAGE_FORMAT","gui")
>
> f = os.popen("r.los --o in=elevation.dem out=tmp \
>         coordinate=603067.6875,4925297.0625 max_dist=10000 2>&1","r",0)

Try with popoen3, to get all your pipes separate:

o,i,f = os.popen3("r.los --o in=elevation.dem out=tmp \
        coordinate=603067.6875,4925297.0625 max_dist=10000", bufsize=0 )

Note the omitted redirection of stderr to stdout.

> try:
>     for line in f:
>         print line
> finally:
>     f.close()
>
> jachym

-- 
-- Daniel Calvelo Aros




More information about the grass-dev mailing list