<p>In python, if I say</p>

<pre><code>print 'h'
</code></pre>

<p>I get the letter h and a newline.  If I say </p>

<pre><code>print 'h',
</code></pre>

<p>I get the letter h and no newline.  If I say</p>

<pre><code>print 'h',
print 'm',
</code></pre>

<p>I get the letter h, a space, and the letter m.  How can I prevent Python from printing the space?</p>

<p>The print statements are different iterations of the same loop so I can't just use the + operator.</p>

```
```
import sys

sys.stdout.write('h')
sys.stdout.flush()

sys.stdout.write('m')
sys.stdout.flush()
```
```
You need to call
```
sys.stdout.flush()
```
because otherwise it will hold the text in a buffer and you won't see it.