Skip to content

Commit bef7e58

Browse files
committed
Update calcGUI.py
1 parent 5daef1e commit bef7e58

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

3 calcGUI/calcGUI.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from tkinter import *
22
from math import sqrt as sqr
3-
3+
from math import sin as Sin
44

55
class Application(Frame):
66
"""
@@ -74,6 +74,7 @@ def calculate(self):
7474
e = e.replace("²", "**2")
7575
e = e.replace("^", "**")
7676
e = e.replace("÷", "/")
77+
e = e.replace("sin", "Sin")
7778

7879
try:
7980
ans = eval(e)
@@ -144,6 +145,9 @@ def create_widgets(self):
144145
Creates the widgets to be used in the grid.
145146
:return: None
146147
"""
148+
self.sin_bttn = Button(self, text="sin", width=9, height=3, command=lambda: self.add_chr('sin'))
149+
self.sin_bttn.grid(row=1, column=6)
150+
147151
self.eq_bttn = Button(self, text="=", width=20, height=3, bg="lightgrey", command=lambda: self.calculate())
148152
self.eq_bttn.grid(row=4, column=4, columnspan=2)
149153

0 commit comments

Comments
 (0)