Add stdout flushing statements to example.
Add stdout flushing statements to example.

This forces the prints to happen right away, so the example behaves a little
more like you'd expect.

ipython/ipython,ipython/ipython