Advertisement
ugochukwu15

Untitled

Aug 4th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. #hey guys
  2. #i am learning GUI using Tkinter in python... i am having a simple problem maybe its from my IDE...'''
  3.  
  4. from tkinter import *
  5.  
  6. def result():
  7. print ("The sum of 2+2 is", 2+2)
  8.  
  9. win = Frame()
  10. win.pack()
  11. Label(win, text='Click Add to get the sum or Quit to Exit').pack(side=TOP)
  12. Button(win, text='Add', command=result).pack(side=LEFT)
  13. Button(win, text='Quit', command=win.quit).pack(side=RIGHT)
  14.  
  15. win.mainloop()
  16.  
  17. #When i run that code the add button works fine but the quit button does not exist out of the window. what am i doing wrong?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement