"qwweeeit" <[EMAIL PROTECTED]> wrote:
> I don't know if this has already been corrected (I use Python 2.3)
> or perhaps is a mistake on my part...
it's a mistake on your part. adding a print statement to the for-
loop might help you figure it out:
> nLastLine=0
> for i in tokenize.generate_tokens(f.readline):
print i
> . if nLastLine != (i[2])[0]: # the 3rd element of the tuple is
> . . nLastLine = (i[2])[0] # (startingRow, startingCol)
> . . fOut.write(i[4])
(hints: what happens if a token spans multiple lines? and how does
the tokenize module deal with comments?)
</F>
--
http://mail.python.org/mailman/listinfo/python-list