I'm trying to see images as generated by the Python Imaging Library. Using the following snippet returns after displaying the image in a separate process. Is there a way to show images and have the python script block until I close the window?
from PIL import Image
img = Image.open(...)
Pillow explicitly starts its Mac and Unix Viewers in the background. Fortunately, Pillow also exposes a way to register custom viewers so you can override this behaviour.
import os from PIL ImageShow class FehViewer(ImageShow.UnixViewer): def show_file(self, filename, **options): os.system('feh %s' % filename) return 1 ImageShow.register(FehViewer, order=-1) [...]