<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 2, 2017 at 3:24 AM, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">But I'm not against a wrapper. I added a prototype with limited<br>
functionality to addons [1]. However, I'm not sure how to account for<br>
large data - that's what discouraged me from creating a wrapper. The<br>
Python subprocess documentation says use communicate() but its doc says<br>
"The data read is buffered in memory, so do not use this method if the<br>
data size is large or unlimited." [2] Do I have to do the buffering<br>
myself then or is it just fine? Is there some code like this in GRASS?<br>
</span></blockquote>
<br>
Wouldn't using pipe_command() and feed_command() in the grass.script be a solution ?</blockquote></div><br><br></div><div class="gmail_extra">I'm using pipe_command() which is just convenience function setting stdout=PIPE. Similarly feed_command() is just setting stdin=PIPE which I'm not using because I'm feeding the stdout of the other process directly (stdin=first_process.stdout). What I don't understand, regardless of using stdin=PIPE or stdin=first_process.stdout for the second process, is what should be next.<br><br><a href="https://grass.osgeo.org/grass70/manuals/libpython/script.html#script.core.pipe_command">https://grass.osgeo.org/grass70/manuals/libpython/script.html#script.core.pipe_command</a><br><a href="https://grass.osgeo.org/grass70/manuals/libpython/script.html#script.core.feed_command">https://grass.osgeo.org/grass70/manuals/libpython/script.html#script.core.feed_command</a><br></div></div>