I\'m on Windows and Python is (very effectively) preventing me from sending a stand-alone \'\\n\' character to STDOUT. For example, the following will output
\'\\n\'
Add 'r' before the string:
sys.stdout.write(r"foo\nvar")
As expected, it also works for print.