title: How to display an image with Pylab from a script in a non blocking way
body: <p>I am writing some iterative image processing algorithm <strong>in a script</strong> (I don't want to be using iPython), and I would like to visualize the image I generate after each iteration. That's very easy to do in Matlab, without blocking the main thread, but I am struggling to do it in Python.</p>
  
  <p>In pylab the <strong>show()</strong> function is blocking and I need to close the window to continue the execution of my script. I have seen that some people use the ion() function, but it has no effect in my case, for example: </p>
  
  <pre><code>pylab.ion()
  img = pylab.imread('image.png')
  pylab.imshow(img)
  pylab.show()
  </code></pre>
  
  <p>is still blocking. I also saw people saying that "using draw instead of plot" can solve this. However, I am not using plot but imshow/show, is there something that I am missing here?</p>
  
  <p>On the other hand, the <strong>PIL</strong> also has some display functions, but it seems to generate a temporary image and then display it with imagemagick, so I assume there is no way here to display an image and update it in the same window with this method.</p>
  
  <p>I am using Ubuntu 10.10.</p>
  
  <p>Does anyone know how to do it simply, or do I have to start using something like Qt to have a minimal GUI that I can update easily?</p>