>>>You don't need to initialise Entry, the for loop does that for you.
>
> just a habit- I've always initialized my vars up front.
> so I know they are initialized.
Fair enough, good practice for other languages certainly.
>> >>BTW Why not just put all this stuff in the body of the try?
>
> Bec
summarizing what folks have already said plus a few more tweaks such
as moving the close() to finally (2.5+), following the style guideline
of variable non-titlecasing, removing unused variables, etc.:
#!/usr/bin/env python2.5
def processFile(inputfile):
try:
fh = open(inputfile, "r")
>I don't understand why readline is producing such unusual behavior.
> I don't remember it working like this previously. The docs say it is
> supposed to read a line at a time.
It does.
> def ProcessFile(self, Inputfile, Outputfile=None):
>
>try:
>fh=open(Inputfile,"r")
>
Tony Cappellini wrote:
>
> I don't understand why readline is producing such unusual behavior.
> I don't remember it working like this previously. The docs say it is
> supposed to read a line at a time.
It does :)
>
> this function
>
> def ProcessFile(self, Inputfile, Outputfile=None):
>
>
I don't understand why readline is producing such unusual behavior.I don't remember it working like this previously. The docs say it is supposed to read a line at a time.this functiondef ProcessFile(self, Inputfile, Outputfile=None):
try: fh=open(Inputfile,"r") ex