Python PIL and Vista/Windows 7 .. show() not working ...

Terry Reedy tjreedy at udel.edu
Mon Nov 30 18:40:42 EST 2009


Esmail wrote:
> On Nov 30, 4:37 pm, David Bolen <db3l.... at gmail.com> wrote:

>> If that's the issue, there are various ways around it.  You could
>> patch PIL itself (same function) to quote the filename when it is
>> constructing the command.  Alternatively, the tempfile module has a
>> tempdir global you could set to some other temporary directory before
>> using the show() function (or any other code using tempfile).
>>
>> -- David
> 
> Thanks for the pointers David, this will give me some things to
> investigate.
> As for me, I'm a long time and regular Linux user with some XP tossed
> in.
> I use the PIL under XP at times, but this problem is happening to
> someone
> I know who is using both Vista and Windows and can't get the basic
> thing
> to work so I am trying to help. (I have access to a Win 7 VM for
> testing
> purposes at least).
> 
> If I find a work-around or fix or concrete cause I'll post. In the
> meantime
> if anyone has any other ideas or fixes/suggestions, please don't be
> shy :-)

How about forget PIL's show and its automagic behavior.
Use PIL's image save to write the image to a nice, known location, such 
as C:/temp/pic.jgp -- nothing but alphanumerics + ':/.'
Next test how to run a known external viewer from a command window.
Then use os.system or subprocess to run it with the same command line.
Package the two lines as a myshow(params) function.




More information about the Python-list mailing list