[GRASS-user] python scripts: printing messages and adding map to tree

Martin Landa landa.martin at gmail.com
Wed Mar 2 02:45:36 EST 2011


2011/3/1 Carlos Grohmann <carlos.grohmann at gmail.com>:
> In my python scripts, I want to print some messages during the calculations,
> like "step 1 complete". But my 'print' statements only show _after_
> the end of the script.
> How to make them show during the process?

print messages to stderr (or flush stdout), `print >> sys.stderr,
"..."`, better to use `grass.message()`

> Also, how to add the resulting map to the tree?

That's not possible. Please report it as a wish on trac.


Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

More information about the grass-user mailing list