pythonian way

Milos Prudek prudek at nembv.cz
Fri Feb 25 08:33:15 CET 2000


The following excerpt works. It reads lines from config file. But I
would like to ask if it is 'right' in the Pythonian way. Since I'm just
beginning in Python I do not want to twist Python into 'my' way of
thinking. 

There is no eof() function for high level readline(), so I use '' to
discover end of file.

A=[]
Line=H.readline()
while Line<>'':
	if Line<>'' and Line<>'\n':
		A.append(Line)
	Line=H.readline()

--
Milos Prudek



More information about the Python-list mailing list