blank lines representation in python

micklee74 at micklee74 at
Tue May 2 08:53:15 CEST 2006

what is the correct way to represent blank lines in python (while
iterating a file) without regexp? I know one way is to use,r'^$') to grab a blank line, but i wanna try not to use
is it
1) if line == ''": dosomething()  (this also means EOF right? )
2) if line is None: dosomething()
3) if not line: dosomething()

More information about the Python-list mailing list