1
import tkMessageBox
from PIL import Image

    elif UserHand == "Scissors":
            tkMessageBox.showinfo("Your choice","You chose: Scissors")
            im = Image.open('C:\\Users\\Jeroen\\Downloads\\Scissors.jpg')
            im.show()

So. What I am trying to do is when a choice is made that it opens the picture, however the screen does open but it says that the file does not exists.

I checked it and when I go to the file path the picture is there. I hope you can help me

I can't post pictures but here are the pictures i wanted to add in:

http://gyazo.com/ce8ceca3128cdd2c95fbb6d77becf710

http://gyazo.com/bb148fd44d3e8117054e635b67635a80

Thanks, Jeroen

Kevin
  • 74,910
  • 12
  • 133
  • 166

1 Answers1

1

So, I have been looking for a few hours last night and I found it was an error in ImageShow.py

I fixed it using this post: PIL image show() doesn't work on windows 7

Community
  • 1
  • 1
  • Also see http://stackoverflow.com/questions/8932976/python-imaging-library-show-on-windows – Mark Ransom Jan 09 '15 at 20:11
  • Thank you @MarkRansom! I am now using this with Tkinter but when I use my image with ImageTk.PhotoImage("example.jpg"), I get this error: TclError: image "" doesn't exist. I thought maybe you can help me with it since I can't post another question cause of my low reputation. – Jeroen van der Wal Jan 09 '15 at 20:24
  • That looks like you're passing an image to a function that requires a filename as a string. – Mark Ransom Jan 09 '15 at 20:39
  • How would I make it that it reads it as an image, because I am giving the path to it as you can see here: http://gyazo.com/b85e4c062d382d5a6443df38dc7efabd – Jeroen van der Wal Jan 09 '15 at 20:43
  • You definitely need to ask a new question. The documentation I find says you can do it exactly the way your code shows. – Mark Ransom Jan 09 '15 at 20:55
  • I can't make a new question at the moment, so I will sit it out and keep trying and searching on how to fix it, I hope it is not something in PIL or Tkinter again. – Jeroen van der Wal Jan 09 '15 at 21:23
  • I also checked this post: http://stackoverflow.com/questions/15718663/tkinter-image-not-showing-or-giving-an-error about .gif – Jeroen van der Wal Jan 09 '15 at 21:29