-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
50 lines (35 loc) · 1.11 KB
/
main.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
43
44
45
46
47
48
49
50
# Python Tkinter GUI based "LOVE CALCULATOR" by "Problem solve with Ridoy"
import tkinter
from tkinter import *
import random
from PIL import ImageTk, Image
root = Tk()
root.geometry('400x240')
root.title('Love Calculator')
img = (Image.open("love.png"))
image1 = img.resize((100, 100), Image.ANTIALIAS)
test = ImageTk.PhotoImage(image1)
label = tkinter.Label(image=test)
label.image = test
label.pack()
def calculate_love():
st = '0123456789'
digit = 2
temp = "".join(random.sample(st, digit))
result.config(text=temp)
heading = Label(root, text='Love Calculator made by "Problem solve with Ridoy"')
heading.pack()
slot1 = Label(root, text="Enter Your Name:")
slot1.pack()
name1 = Entry(root, border=5)
name1.pack()
slot2 = Label(root, text="Enter Your Partner Name:")
slot2.pack()
name2 = Entry(root, border=5)
name2.pack()
bt = Button(root, text="Calculate", height=1, width=7, command=calculate_love)
bt.pack()
result = Label(root, text='Love Percentage between both of You:')
result.pack()
root.mainloop()
#If you have any confusion, feel free to contact me https://www.facebook.com/problemsolvewithridoy/