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 function

def ProcessFile(self, Inputfile, Outputfile=None):
       
        try:
            fh=open(Inputfile,"r")
        except IOError:
            print"\nError ocurred opening %s for input\n" % Inputfile
        else:
            FixedEntry = []
            Entry = ""
            for Entry in fh.readline():
                print"Entry = %s" % Entry
                          
            fh.close()

is producing this result

Entry = A
Entry = l
Entry = i
Entry = a
Entry = s
Entry = ,
Entry = P
Entry = h
Entry = o
Entry = n
Entry = e

With this input file
Alias,Phone
JANE SMITH,12131234567

Readline is supposed to read an entire line on each call, yet it is only reading one character.



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to