SyntaxFix
Write A Post
Hire A Developer
Questions
You should open text files using rU so newlines are properly transformed, see http://docs.python.org/library/functions.html#open. This way there's no need to check for \r\n.
rU
\r\n