Request for Enhancement

Samuel A. Falvo II kc5tja at garnet.armored.net
Wed Aug 30 22:13:31 EDT 2000


In article <39ADBE5A.189FEA7E at holdenweb.com>, Steve Holden wrote:
>The classic pythonic method of processing such files is:
>
>while 1:			# loop forever
>    line = F.readline		# get the next line
>    if line == "": break	# null string indicates EOF
>    ... process line ...
>
>It often seems unnatural to Python newcomers, but you get used to it!

This is extremely unnatural to me; checking for end of file explicitly is
much more readable.  However, if it works, then it works.  :)

Thanks for the tip.

-- 
KC5TJA/6, DM13, QRP-L #1447 | Official Channel Saint, *Team Amiga*
Samuel A. Falvo II	    |
Oceanside, CA		    |



More information about the Python-list mailing list