iterating over lines in a file

nobody no at bo.dy
Fri Jul 21 00:04:32 EDT 2000


scarblac-spamtrap at pino.selwerd.nl (Remco Gerlich), in
<slrn8nd7dp.gtf.scarblac-spamtrap at flits104-37.flits.rug.nl>:

> import fileinput
> for line in fileinput.input("somefile"):
>    process(line)

ah, many thanks! i'm still spelunking my way around the standard
library; gems like this seem to be lying around all over it. :-)




More information about the Python-list mailing list