[Tutor] Re: problems with re module

Lee Harr missive at hotmail.com
Sat Nov 15 19:40:41 EST 2003

>the output is:
><row>type of col is: <type 'str'>       Col is: Race

You are using CurrentLine in two different places, and
in two different ways.  Here at the beginning, it is
a string...

CurrentLine = ""
for line in f:
        if line.isspace() or line == '':
        elif line[0] == '+':
                if initial:
                        writeln("<tgroup cols='%d'>\n<tbody>\n" % 
                        #can we assume that formatting ends with a newline? 
probably - for the time
                        if CurrentLine:
                                #process the line here:
                                CurrentLine = 

and now here, you change it in to a list.

Try changing the name of one of these, or rethinking your algorithm.

Add photos to your messages with MSN 8. Get 2 months FREE*. 

More information about the Tutor mailing list