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

Paul St George email at paulstgeorge.com
Wed May 30 16:01:35 EDT 2018


True, but I wanted to have some control over the image window, 
fullscreen, colour depth, etc. I am also exploring pygame. I will try 
your suggestion as it is so much simpler.

Being a novice, I had been frightened off using shell=True. See 
<https://docs.python.org/2/library/subprocess.html#frequently-used-arguments>.

Is this equivalent?
p = subprocess.Popen('display',  + imagepath)

so

p = subprocess.Popen('display',  'test.png')





On 30/05/2018 03:04, Ian Kelly wrote:
> 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)
>

-- 
Paul St George
http://www.paulstgeorge.com
http://www.devices-of-wonder.com

+44(0)7595 37 1302




More information about the Python-list mailing list