-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBasic_Calculator_With_Python
More file actions
53 lines (42 loc) · 1.82 KB
/
Basic_Calculator_With_Python
File metadata and controls
53 lines (42 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Program: A Basic Calculator built with Python
# First Commit : 23:44, 07 July 2021
# Author: Oluwafemi Oreoluwa
from tkinter import *
class Application(Frame):
"""GUI Class for the Calculator"""
def __init__(self,master):
super(Application,self).__init__(master)
self.grid()
self.calc_widgets()
def calc_widgets(self):
#self.buttonlist=["1","2","3","4","5","6","7","8","9"]
#self.buttontray=[]
#Calculator GUI Label
Label(self,text="Basic Calculator").grid(row=0,column=0,sticky=W)
self.textbox=Text(self,height=3,width=85,wrap=WORD)
self.textbox.grid(row=7,column=0,columnspan=3)
#Numeric Digits
#Button(self,text="7").grid(row=9,column=0,sticky=W)
#Button(self,text="8").grid(row=9,column=0)
#Button(self,text="6").grid(row=4,column=0,sticky=W)
#Button(self,text="5").grid(row=4,column=1,sticky=W)
#Button(self,text="4").grid(row=4,column=0,sticky=W)
#Button(self,text="3").grid(row=4,column=1,sticky=W)
#B utton(self,text="2").grid(row=4,column=0,sticky=W)
#Button(self,text="1").grid(row=4,column=1,sticky=W)
#Button(self,text="0").grid(row=4,column=0,sticky=W)
# Arithmetic Operations
#Button(self,text="+").grid(row=4,column=1,sticky=W)
#Button(self,text="-").grid(row=4,column=0,sticky=W)
#Button(self,text="/").grid(row=4,column=1,sticky=W)
#Button(self,text="x").grid(row=4,column=0,sticky=W)
#Button(self,text="=").grid(row=4,column=1,sticky=W)
#Button(self,text="+/-").grid(row=4,column=1,sticky=W)
#Text Erase Button. button name is "clear"
#Button(self,text="Clear").grid(row=4,column=1,sticky=W)
#main
root=Tk()
root.title("Calculator")
root.geometry("300x300")
okay=Application(root)
root.mainloop()