import StringIO
output = StringIO.StringIO()
output.write('this is the first line\n the new line should come here')
a = output.getvalue()
output.close()
print a
But the new line character \n
does not get printed as a new line.
How do I get a newline?