-------- Python Code ------------
( Are you idiot - ( Yes/No )
ππππππππππππ
import tkinter as tk
import random
def show_popup():
Β Β Β popup = tk.Toplevel(root)
Β Β Β popup.title("Popup")
Β Β Β label = tk.Label(popup, text="Thanks for Accepting")
Β Β Β label.pack(padx=20, pady=20)
def move_button(event):
Β Β Β x = random.randint(0, 350)
Β Β Β y = random.randint(0, 350)
Β Β Β no_button.place(x=x, y=y)
root = tk.Tk()
root.title("@coderslearning")
root.geometry("400x400")
question_label = tk.Label(root, text="Are you idiot ?")
question_label.pack(pady=20)
yes_button = tk.Button(root, text="Yes", command=show_popup)
yes_button.pack()
no_button = tk.Button(root, text="No")
no_button.pack()
no_button.bind("", move_button)
root.mainloop()
( Are you idiot - ( Yes/No )
ππππππππππππ
import tkinter as tk
import random
def show_popup():
Β Β Β popup = tk.Toplevel(root)
Β Β Β popup.title("Popup")
Β Β Β label = tk.Label(popup, text="Thanks for Accepting")
Β Β Β label.pack(padx=20, pady=20)
def move_button(event):
Β Β Β x = random.randint(0, 350)
Β Β Β y = random.randint(0, 350)
Β Β Β no_button.place(x=x, y=y)
root = tk.Tk()
root.title("@coderslearning")
root.geometry("400x400")
question_label = tk.Label(root, text="Are you idiot ?")
question_label.pack(pady=20)
yes_button = tk.Button(root, text="Yes", command=show_popup)
yes_button.pack()
no_button = tk.Button(root, text="No")
no_button.pack()
no_button.bind("", move_button)
root.mainloop()