Re: [Tutor] Unusual behavior in readline

2006-08-09 Thread Alan Gauld
>>>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

Re: [Tutor] Unusual behavior in readline

2006-08-08 Thread wesley chun
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")

Re: [Tutor] Unusual behavior in readline

2006-08-08 Thread Alan Gauld
>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") >

Re: [Tutor] Unusual behavior in readline

2006-08-08 Thread Luke Paireepinart
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): > >

[Tutor] Unusual behavior in readline

2006-08-08 Thread Tony Cappellini
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