[GRASS-user] Silent commands in python

Daniel Victoria daniel.victoria at gmail.com
Mon Dec 3 18:48:10 EST 2007


Hi all,

This might be more of a python problem but here it goes...
I wrote a water balance script in python to run under GRASS. What I
would like now is that the commands in the python script would be
silent, that is, no return from stdout or stderr.
For instance every time I call a r.mapcalc function I get the 0-100%
count. I'd like to silence that and other commands.

In the shell I would silence command outputs using &> /dev/null, for exemple:
echo "blabla=2*bla" | r.mapcalc &> /dev/null

But in python that does not work using the os.system() function, that is:
os.system("echo 'blabla=2*bla' | r.mapcalc &> /dev/null")

Anyone has any tips on the matter?

Thanks
Daniel


More information about the grass-user mailing list