SHARE
TWEET

UnsupportedOperation: seek

pleabargain Jun 8th, 2013 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import tkinter as tk
  3.  
  4. from urllib.request import urlopen
  5. from PIL import ImageTk, Image
  6.  
  7. image = urlopen('https://www.google.com/images/srpr/logo4w.png')
  8. resized_image = Image.open(image)
  9.  
  10. root = tk.Tk()
  11. img = ImageTk.PhotoImage(resized_image)
  12. panel = tk.Label(root, image=img)
  13. panel.pack(side="bottom", fill="both", expand="yes")
  14. root.mainloop()
  15. ---------------------------------------------------------------------------
  16. UnsupportedOperation                      Traceback (most recent call last)
  17. <ipython-input-2-895b591b58f6> in <module>()
  18.       5
  19.       6 image = urlopen('https://www.google.com/images/srpr/logo4w.png')
  20. ----> 7 resized_image = Image.open(image)
  21.       8
  22.       9 root = tk.Tk()
  23.  
  24. /usr/local/lib/python3.2/dist-packages/PIL/Image.py in open(fp, mode)
  25.    1998             factory, accept = OPEN[i]
  26.    1999             if not accept or accept(prefix):
  27. -> 2000                 fp.seek(0)
  28.    2001                 return factory(fp, filename)
  29.    2002         except (SyntaxError, IndexError, TypeError):
  30.  
  31. UnsupportedOperation: seek
RAW Paste Data
Want to get better at Python?
Learn to code Python in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top