hi i am making a code using tkinter that has button and i want it to do different thing is the button is pressed.
import tkinter as tk
Height = 500
Width = 700
def comp():
if ? == ?:
print("hi")
elif ? == ?:
print("bye")
elif ? == ?:
print("trump")
elif ? == ?:
print("bidden")
window = tk.Tk()
canvas = tk.Canvas(window, height=Height, width=Width)
canvas.pack()
frame = tk.Frame(window)
frame.place(relx=0,rely=0, relheight=1, relwidth=1)
label = tk.Label(frame, text="hello malcom what would you like to do?")
label.place(relx=0.3, rely=0, relwidth=0.45, relheight=0.20)
button = tk.Button(frame, text="add someone new", bg='black', fg='white', command=comp)
button.place(relx=0.3, rely=0.2, relwidth=0.45, relheight=0.10)
button1 = tk.Button(frame, text="register a visit", bg='black', fg='white', command=comp)
button1.place(relx=0.3, rely=0.4, relwidth=0.45, relheight=0.10)
button2 = tk.Button(frame, text="view data", bg='black', fg='white', command=comp)
button2.place(relx=0.3, rely=0.6, relwidth=0.45, relheight=0.10)
button3 = tk.Button(frame, text="end program", bg='black', fg='white', command=comp)
button3.place(relx=0.3, rely=0.8, relwidth=0.45, relheight=0.10)
window.mainloop()
as you can see i have the buttons on a frame and i need it to do specific things dependat on what was pressed please can someone advise on what to do?