Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. from Tkinter import *
  2. from tkinter import filedialog
  3. from PIL import Image, ImageTk
  4.  
  5.  
  6. def openFile():
  7.     global newphoto,msg,idraw,img
  8.     path = filedialog.askopenfilename(initialdir="/", title="Select Günther", filetypes=(("jpeg files", ".jpg"), ("png files", ".png"), ("gif files", ".gif")))
  9.     im = Image.open(path)
  10.     newphoto = ImageTk.PhotoImage(im)
  11.     myvar.configure(image = newphoto)
  12.  
  13.  
  14. root = Tk()
  15. root.title("GentCon")
  16.  
  17. loadButton = Button(root, text="Load Günther...", command=openFile)
  18. loadButton.pack()
  19.  
  20. canvas = Canvas(root, width = 800, height=480)
  21. canvas.pack()
  22.  
  23. myvar = Label(canvas, text="Warte auf Günther")
  24. myvar.pack()
  25.  
  26. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement