"Stef Mientki" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
|     if Print_Info: print Datafile.readline()
|     else:                Datafile.readline()

Since both branches discard the data read, I presume Martin's fix is what 
you really want.

| Is there a more compressed way to write such a statement,
| especially I dislike the redundancy "Datafile.readline()".

But for future reference, if you really do need to call a method in 
multiple places (or even just multiple times in a loop) you can condense 
like so:

dread = Datafile.readline # followed by
...
dread() # as needed

Terry Jan Reedy





-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to