How to display images? - Repost

Fredrik Lundh effbot at telia.com
Tue May 16 19:05:46 CEST 2000


David Lees <debl.nospamm at world.std.com> wrote:
> How does one display images in Python.  I am using Python 1.5.2 and PIL
> running under Win95 and am able to read, write and rotate images to the
> disk without any problem.  tkinter is installed. However, when I use the
> .show method it does not seem to work.

"show" works just fine on my win95 box.

maybe you don't have a BMP viewer installed?  try saving
a file as BMP, and run the "start" command on it from the
MS-DOS window:

    > python
    ...
    >>> import Image
    >>> im = Image.open("...")
    >>> im.save("myfile.bmp")
    >>> [ctrl-Z]
    > start myfile.bmp

if this doesn't work, check the file associations, or hack
Image.py so it uses another default format.

</F>




More information about the Python-list mailing list