Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import tkinter as tk
  2.  
  3. class MyApp(tk.Tk):
  4.  
  5. def __init__(self, *args, **kwargs):
  6. tk.Tk.__init__(self, *args, **kwargs)
  7.  
  8. def hello():
  9. print("hello2")
  10.  
  11. submit_button = tk.Button(self, text="Submit", command=lambda:
  12. MyApp.test1())
  13. submit_button.pack()
  14.  
  15. def test1():
  16. print("hello")
  17. MyApp.hello()
  18.  
  19. if __name__ == "__main__":
  20. app = MyApp()
  21. app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement