tail -f sys.stdin

garabik-news-2005-05 at kassiopeia.juls.savba.sk garabik-news-2005-05 at kassiopeia.juls.savba.sk
Thu Jun 9 10:17:46 EDT 2005


Antal Rutz <arutz at mimoza.pantel.net> wrote:
> Hi!
> 
> Maybe a very newbie question but:
> I'd like to write a prog which reads one line at a time on its sys.stdin
> and immediately processes it.
> If there are'nt any new lines wait (block on input).
> 

what about:

for line in sys.stdin:
    process(line)

-- 
 -----------------------------------------------------------
| Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__    garabik @ kassiopeia.juls.savba.sk     |
 -----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!



More information about the Python-list mailing list