forked from DivyanshMalhotra/HashHacks3_jsk1961998935
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
42 lines (38 loc) · 1.08 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'''
from tkinter import *
from PIL import ImageTk,Image
root = Tk()
canvas = Canvas(root, width = 500, height = 500)
canvas.pack()
img = ImageTk.PhotoImage(Image.open("downloaded.jpg"))
img.subsample(2,2)
def helloCallBack():
print( "Hello Python", "Hello World")
B = Button(root, text ="Hello", command = helloCallBack)
B.pack()
canvas.create_image(50,50 , anchor=NW, image=img)
root.mainloop()
'''
from tkinter import *
import tkinter
import tkinter.messagebox
from PIL import Image
from PIL import ImageTk
master = Tk()
def callback():
print("click!")
def quitf():
master.destroy()
width = 500
height = 300
canvas = Canvas(master, width = 500, height = 500)
canvas.pack()
img = Image.open("downloaded.jpg")
img = img.resize((width,height), Image.ANTIALIAS)
photoImg = ImageTk.PhotoImage(img)
canvas.create_image(50,50 , anchor=NW, image=photoImg)
b = Button(master,text='Report it to people nearby', command=callback, width=50)
b.pack()
c = Button(master,text='No, it is not an issue', command=quitf, width=50)
c.pack()
mainloop()