idiomatic analogue of Perl's: while (<>) { ... }

Anssi Saari as at sci.fi
Thu Sep 1 17:25:30 CEST 2011


Sahil Tandon <sahil at FreeBSD.org> writes:

> I've been tasked with converting some programs from Perl -> Python, and
> am (as will soon be obvious) new to the language. 

If it's any help, I have usually done handling of standard input line by
line with this kind of thing:

for inputline in sys.stdin:



More information about the Python-list mailing list