Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- from tkinter import filedialog
- from PIL import Image, ImageTk
- def openFile():
- global newphoto,msg,idraw,img
- path = filedialog.askopenfilename(initialdir="/", title="Select Günther", filetypes=(("jpeg files", ".jpg"), ("png files", ".png"), ("gif files", ".gif")))
- im = Image.open(path)
- newphoto = ImageTk.PhotoImage(im)
- myvar.configure(image = newphoto)
- root = Tk()
- root.title("GentCon")
- loadButton = Button(root, text="Load Günther...", command=openFile)
- loadButton.pack()
- canvas = Canvas(root, width = 800, height=480)
- canvas.pack()
- myvar = Label(canvas, text="Warte auf Günther")
- myvar.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement