Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. from tkinter import *
  2. from PIL import Image, ImageTk
  3. import time
  4.  
  5. t = Tk()
  6. t.resizable(False, False)
  7. t.attributes('-fullscreen', True)
  8.  
  9. width = t.winfo_screenwidth()
  10. height = t.winfo_screenheight()
  11. padding = 50
  12.  
  13. c = Canvas(t, bd=-2, width=width, height=height, bg="#434343")
  14. c.pack()
  15.  
  16. def render():
  17. c.delete("all")
  18. c.create_image(width / 2, height / 2, image=ImageTk.PhotoImage(Image.open("image.jpg")))
  19. c.update()
  20.  
  21. def stop(event):
  22. running = False
  23. t.destroy()
  24.  
  25. t.bind("<Escape>", stop)
  26.  
  27. running = True
  28.  
  29. try:
  30. while running:
  31. render()
  32. t.update()
  33. except:
  34. Exception
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement