pythonian way

Alan Daniels daniels at mindspring.com
Sat Feb 26 00:08:24 EST 2000


>A = []
>for Line in H.readlines():
>    if Line not in ("", "\n"):
>        A.append(Line)

Doh! Just remembered, any line returned from readline or readlines
will *never* be empty (as in ""), so there's no need to check for it.
Just checking Line != "\n" should do everything you want. Why oh why
do I post *anything* past 11:00 in the evening?

Like-correcting-your-own-posting-isn't-bad-enough-ly yours, Alan.

-- 
=======================
Alan Daniels
daniels at mindspring.com
daniels at cc.gatech.edu



More information about the Python-list mailing list