Algo como:

   import sys

   for linea in sys.stdin.readlines():
        print linea

tal vez te de mas juego.

Saludos,
Carlos L.



El 8 de agosto de 2013 07:05, xiao xiong mao panda rojo <
ailurus.fulg...@hotmail.com> escribió:

> doh!
> gracias. funciono bien aqui.
> me estaba complicando la vida en vano XD
>
> > Date: Wed, 7 Aug 2013 23:48:41 -0500
> > From: razpei...@gmail.com
> > To: python-es@python.org
> > Subject: Re: [Python-es] como leer una tuberia?
>
> >
> > # main.py
> > try:
> > while True:
> > print raw_input()
> > except EOFError:
> > pass
> >
> > A me funciono bien.
> > cat input.txt | python main.py
> >
> >
> > El 7 de agosto de 2013 23:31, xiao xiong mao panda rojo
> > <ailurus.fulg...@hotmail.com> escribió:
> > >
> > > hola. otra ves con una pregunta rara.
> > > como hago que mi script lea los datos que recibe por una tubería?
> > > intente algo como
> > >
> > > print raw_input()
> > >
> > > y luego hice
> > > $: echo "probando" | python script.py
> > > probando
> > > funciona pero cuando lo hago con un archivo solo imprime la primera
> linea.
> > > cat archivoConVariasLineas | python script.py
> > >
> > > si lo intento con un bucle tengo problemas con las lineas vacias
> > > debe haber alguna forma mas adecuada de hacer esto.
> > >
> > > tienen alguna sugerencia? gracias
> > >
> > > _______________________________________________
> > > Python-es mailing list
> > > Python-es@python.org
> > > http://mail.python.org/mailman/listinfo/python-es
> > > FAQ: http://python-es-faq.wikidot.com/
> > >
> > _______________________________________________
> > Python-es mailing list
> > Python-es@python.org
> > http://mail.python.org/mailman/listinfo/python-es
> > FAQ: http://python-es-faq.wikidot.com/
>
> _______________________________________________
> Python-es mailing list
> Python-es@python.org
> http://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
>
>
_______________________________________________
Python-es mailing list
Python-es@python.org
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a