Run python script without printing newline at end?
<p>Whenever I run a python script, a new line is also printed at the end.</p>

<p>The only way I can stop this is by using posix._exit(0) at the end to avoid Python's cleanup code. Is there a more portable way?</p>

<p>(Sorry if this is a repeat question/seemingly obvious to answer. Unfortunately, I've only seen questions about printing without a newline)</p>

<p>Example script:</p>

<pre><code>import os
#nothing actually done
</code></pre>

<p>Non-portable solution:</p>

<pre><code>import os,posix
#nothing actually done
posix._exit()
</code></pre>

<p>OS: Windows
Tested with: Python in cygwin, native PyPy</p>
