Print with no new line python
<p>I have checked out the possible duplicates nonetheless they are not working out for me.</p>

<p>What I am trying to do is rotate a numpy array and I want to see this as an animation in the terminal:</p>

<pre class="lang-py prettyprint-override"><code>if __name__ ==  "__main__":
o = np.ones((10,10))
while True:
    for i in xrange(361):
        sys.stdout.write(repr(rot_position(o, i)))
</code></pre>

<p>Tried print followed by a comma and it does not work either. How can I make it always print on the same line (that works on python 2.7x)?</p>