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

Hi all,

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?

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

tks

--
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
http://lattes.cnpq.br/5846052449613692
Linux User #89721
________________
Can’t stop the signal.

Hi,

2011/3/1 Carlos Grohmann <carlos.grohmann@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

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