skip420

duel button

Nov 22nd, 2020
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import tkinter as tk  
  2.  
  3. def write_text():
  4.     print("thank you for choosing Trump!")
  5.  
  6. parent = tk.Tk()
  7. frame = tk.Frame(parent)
  8. frame.pack()
  9.  
  10. text_disp= tk.Button(frame,
  11.                    text="Trump",
  12.                     fg="red",
  13.                    command=write_text
  14.                    )
  15.  
  16. text_disp.pack(side=tk.LEFT)
  17.  
  18. exit_button = tk.Button(frame,
  19.                    text="Biden",
  20.                    fg="blue",
  21.                    command=write_text)
  22. exit_button.pack(side=tk.RIGHT)
  23.  
  24. parent.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment