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

Anssi Saari as at
Thu Sep 1 11:25:30 EDT 2011

Sahil Tandon <sahil at> 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