Advertisement
Lledya

Hello

Sep 29th, 2019
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. import tkinter as tk
  2. class Application (tk.Frame):
  3.     def __init__(self, master=None):
  4.         super () .__init__(master)
  5.  
  6.         self.pack ()
  7.  
  8.     app = Application ()
  9.     app.master.title("Sumator")
  10.     app.master.minsize (width=100, height=50)
  11.     app.mainloop()
  12.  
  13.     def __init__(self, master=None):
  14.         super() .__init__(master)
  15.  
  16.         self.pack()
  17.         self.create_widgets()
  18.  
  19.         def create_widgets(self):
  20.             self.firstNumberEntry = tk.Entry()
  21.             self.plusSign = tk.Label(text="+")
  22.             self.secondNumberEntry = tk.Entry()
  23.             self.equalSign = tk.Label(text="=")
  24.             self.resultLAbel = tk.Label(text="Result...", bg="green", fg="white")
  25.             self.calculateButton = tk.Button(text="Calculate")
  26.  
  27.             self.firstNumberEntry.pack(side="left")
  28.             self.plusSign.pack(side="left")
  29.             self.secondNumberEntry.pack(side="left")
  30.             self.equalSign.pack(side="left")
  31.             self.resultLabel.pack(side="left")
  32.             self.calculateButton.pack(side="left")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement