stdin -> stdout

max(01)* max2 at fisso.casa
Fri Aug 19 11:26:27 EDT 2005


hi.

i was wondering, what's the simplest way to echo the standard input to 
the standard output, with no modification.

i came up with:

...
while True:
   try:
     raw_input()
   except EOFError:
     break
...

but i guess there must be a simpler way.

using bash i simply do 'cat', *sigh*!

bye

max

ps: in perl you ca do this:

...
while ($line = <STDIN>)
   {
     print STDOUT ("$line");
   }
...



More information about the Python-list mailing list