[GRASS-dev] python and GRASS_MESSAGE_FORMAT
jachym.cepicky at centrum.cz
Sat Nov 25 14:42:15 EST 2006
On Sat, Nov 25, 2006 at 06:56:14PM +0000, Glynn Clements wrote:
> The documentation for the readlines() method says:
> Read until EOF using readline() and return a list containing the
> lines thus read. If the optional sizehint argument is present,
> instead of reading up to EOF, whole lines totalling approximately
> sizehint bytes (possibly after rounding up to an internal buffer
> size) are read. Objects implementing a file-like interface may
> choose to ignore sizehint if it cannot be implemented, or cannot
> be implemented efficiently.
> The "until EOF" means that it isn't going to return until the command
> has completed.
> > Could somebody help me, how to do it? Could you point me to tcl code,
> > which must solve this problem too?
> Looking at the Python docs, you probably want something like:
> f = os.popen("r.los in=elevation.dem out=tmp 2>&1")
> for line in f:
> print line
thanks, Glynn, but it does not seem to work - or it works the same way,
like readlines() does.
I have in the script:
f = os.popen("r.los --o in=elevation.dem out=tmp \
coordinate=603067.6875,4925297.0625 max_dist=10000 2>&1")
for line in f:
result is, lines are printed. but _after_ r.los finished it's
do I understand something wrong?
e-mail: jachym.cepicky at centrum.cz
Department of Geoinformation Technologies
613 00, Brno
e-mail: xcepicky at node.mendelu.cz
Tel.: +420 545 134 514
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20061125/32f24f41/attachment.bin
More information about the grass-dev