The "loop and a half"

Peter J. Holzer hjp-usenet3 at hjp.at
Sun Oct 8 10:04:17 EDT 2017


On 2017-10-07 13:19, Steve D'Aprano <steve+python at pearwood.info> wrote:
> On Sat, 7 Oct 2017 11:06 pm, bartc wrote:
>> However it does seem to expose a flaw in the ability of command line
>> tools to work with non-command line tools.
>> 
>> So I have to copy 33,000 lines from a document, 
>
> Don't be daft. Nobody says that stdin is a sufficient interface for a
> heavy-weight task like that. With 33000 lines of text, I absolutely would
> save them to a permanent file on disk,

I think you got sucked into bartc's way of thinking here.

Of course stdin is perfectly fine for reading 33000 lines of text. You
probably do that all the time. Think of pipes like "... | grep ... |
sort | uniq | ...": No reason to save the output of one stage to a
temporary file before invoking the next just because it might be large.

It's the terminal which is not a good interface for entering 33000 lines
of text, even though pasting 33000 lines from the clipboard into
xterm works (I vaguely recall that there is or was a size limit, but
33000 shortish lines doesn't seem to be enough to reach it).

        hp


-- 
   _  | Peter J. Holzer    | Fluch der elektronischen Textverarbeitung:
|_|_) |                    | Man feilt solange an seinen Text um, bis
| |   | hjp at hjp.at         | die Satzbestandteile des Satzes nicht mehr
__/   | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel



More information about the Python-list mailing list