I’m running a few functions inside grass.run_command and I wanted to use the --quiet flag but I cannot find any information about it. I have tried flag=‘q’, flag=‘–quiet’ and jut ‘–quiet’ but non of these are accepted.
2010/10/18 Helena Herrera <helenaherrera1980@gmail.com>:
I'm running a few functions inside grass.run_command and I wanted to use the
--quiet flag but I cannot find any information about it. I have tried
flag='q', flag='--quiet' and jut '--quiet' but non of these are accepted.
> I'm running a few functions inside grass.run_command and I wanted to use the
> --quiet flag but I cannot find any information about it. I have tried
> flag='q', flag='--quiet' and jut '--quiet' but non of these are accepted.
Hi there
I have tried:
check_input= grass.run_command(“g.findfile”, element=‘cell’, file=i, mapset=mapsetc, quiet=“True”)
and I still got that boring print . What am I missing?
Thanks
I’m running a few functions inside grass.run_command and I wanted to use the
–quiet flag but I cannot find any information about it. I have tried
flag=‘q’, flag=‘–quiet’ and jut ‘–quiet’ but non of these are accepted.
2010/10/18 Helena Herrera <helenaherrera1980@gmail.com>:
check_input= grass.run_command("g.findfile", element='cell', file=i,
mapset=mapsetc, quiet="True")
and I still got that boring print . What am I missing?
verbosity level (quiet/verbose) only affects printing
messages/warnings. In this case 'g.findfile' prints its output to
stdout, so it's printed regardless of quite or verbose flags.
In some functions, for instance g.remove even after using quiet=True ther warnings are still beng printed. was tha expected?
Regarding GDALWARP, I’m running this command:
grass.debug(“gdalwarp -t_srs %s -srcnodata %s -dstnodata %s -tr %s %s %s %s” % (proj_location, no_value, no_value, t_srx, t_sry, input, tempfile))
can I use something in order to avoid all the printing that this does?
Maybe I was not clear. What GRASS is doing is printing and I don’t want ot
print those messages. So, what you are saying is that I’m not able to avoid
the printing og g.findfile?
as I wrote in the previous mail use grass.find_file(). Seems to me
that I am not understanding well, running
In some functions, for instance g.remove even after using quiet=True ther
warnings are still beng printed. was tha expected?
--quiet suppresses messages; it doesn't suppress warnings.
Regarding GDALWARP, I'm running this command:
grass.debug("gdalwarp -t_srs %s -srcnodata %s -dstnodata %s -tr %s %s %s %s"
% (proj_location, no_value, no_value, t_srx, t_sry, input, tempfile))
can I use something in order to avoid all the printing that this does?
You can redirect stdout and/or stderr to the null device (/dev/null on
Unix, "nul" on Windows), e.g.: