Products > Programming

Viewing JPG Images in Python Using XP

(1/2) > >>

I have an XP machine with Python 3.3 and I'm trying to create a program that will view images in a directory randomly. I'm starting with the basic approach of trying to just open/view an image and found multiple ways to do it, however, none of them work (after I figure out this, then I'll move onto incorporating a random viewing program).

I'm using Notepad++, saving it as a, and double clicking the .py file.

The most basic one that I found that causes a window to open and close without doing anything else is:

from PIL import Image

#read the image
im ="image.jpg")

#show image

You nee to run it from the command line or some IDE and you will see the error output. In this specific case you likely have no PIL library installed.

I tried installing PIL, Pillow (thought I read Pillow replaced PIL), etc...

Seems I couldn't install it no matter what format I tried.

Run it from the command line and looks at the reported error.

>>> pip install pil
  File "<stdin>", line 1
    pip install pil


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod