[Tutor] Can't detect empty line

Mike Yuen myuen@ucalgary.ca
Sun, 18 Nov 2001 11:51:00 -0700 (MST)


I know that I can detect an empty line when reading in a file simply by
going:
if line == '\n':
        # Do stuff

However, i'm having a serious problem trying to detect an empty line.
I'm using Linux and when I do a "cat -ve input".  The line i'm interested
in has a ^M$ implying there's a return character on that empty line.
For some reason, it's reading in the line as if there's stuff on that
empty line.

I've tried to strip, lstrip, etc to clean the line up so I might be able
to better detect an empty line but no luck.

Is there any other way to find detect an empty line?

Thanks,
M