stdio EOF ?

Jacek Generowicz jacek.generowicz at
Fri Aug 9 17:15:33 CEST 2002

I'm trying to write a filter (between the GNU plotutils ode and
graph). The problem I have is making it work in a situation like this:

  cat | | whatever

 (ode -f foo | | graph ... in reality)

The desired behaviour is that I should be able to type instructions
into standard input (which ode reacts to, sending data down the
pipeline) which the filter should process and pass on down the
pipeline without waiting ... but should stop when I send EOF.

Using "for line is stdin: ..." works if all the commands are in a file
and I do

  cat command_file | | etc

but in the "cat |" situation, it doesn't produce any output
until C-d is sent.

I guess I'm looking for a "while something(stdin)" or "while
stdin.something" construct ...

Any ideas ?


More information about the Python-list mailing list