The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

Ian Kelly ian.g.kelly at gmail.com
Tue May 29 21:04:06 EDT 2018


On Sat, May 26, 2018 at 9:17 AM, Paul St George <email at paulstgeorge.com> wrote:
> Thank you.
> You are very right. The show() method is intended for debugging purposes and
> is useful for that, but what method should I be using and is PIL the best
> imaging library for my purposes? I do not want to manipulate images, I only
> want to show images (full screen) on an external display. I want to use
> Python to control the timing of the images.

You probably shouldn't be using PIL at all then. Why open the file in
Python just to export it and re-open it in an image viewer? It would
be simpler just to point whichever image viewer you prefer at the
original file directly. Your entire script could just be something
like this:

import subprocess

# Some timing logic

subprocess.call("display " + imagepath, shell=True)



More information about the Python-list mailing list