Python 3: Write newlines to HTML
normally I do like this s=s.replace("\n","<br />\n") 
because 
<br /> is needed in web page display and 
\n is needed in source display.
just my 2 cents
I have upgraded to Python 3 and can't figure out how to convert backslash escaped newlines to HTML.
The browser renders the backslashes literally, so "\n" has no effect on the HTML source. As a result, my source page is all in one long line and impossible to diagnose.