1010# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1111# SOFTWARE.
1212
13- """PyCalc is a simple calculator built using Python, and PyQt5."""
13+ """PyCalc is a simple calculator built using Python and PyQt5."""
1414
1515import sys
1616from functools import partial
1717
18- # Import QApplication, and the required widgets from PyQt5.QtWidgets
18+ # Import QApplication and the required widgets from PyQt5.QtWidgets
1919from PyQt5 .QtWidgets import QApplication
2020from PyQt5 .QtWidgets import QMainWindow
2121from PyQt5 .QtWidgets import QWidget
@@ -41,12 +41,12 @@ def __init__(self):
4141 # Set some main window's properties
4242 self .setWindowTitle ("PyCalc" )
4343 self .setFixedSize (235 , 235 )
44- # Create, and set the central widget, and the general layout
44+ # Create and set the central widget and the general layout
4545 self .generalLayout = QVBoxLayout ()
4646 self ._centralWidget = QWidget (self )
4747 self .setCentralWidget (self ._centralWidget )
4848 self ._centralWidget .setLayout (self .generalLayout )
49- # Create the display, and the buttons
49+ # Create the display and the buttons
5050 self ._createDisplay ()
5151 self ._createButtons ()
5252
@@ -88,7 +88,7 @@ def _createButtons(self):
8888 "+" : (3 , 3 ),
8989 "=" : (3 , 4 ),
9090 }
91- # Create the buttons, and add them to the grid layout
91+ # Create the buttons and add them to the grid layout
9292 for btn_text , pos in buttons .items ():
9393 self .buttons [btn_text ] = QPushButton (btn_text )
9494 self .buttons [btn_text ].setFixedSize (40 , 40 )
@@ -121,15 +121,15 @@ def evaluateExpression(expression):
121121 return result
122122
123123
124- # Create a Controller class to connect the GUI, and the model
124+ # Create a Controller class to connect the GUI and the model
125125class PyCalcCtrl :
126126 """PyCalc's Controller."""
127127
128128 def __init__ (self , model , view ):
129129 """Controller initializer."""
130130 self ._evaluate = model
131131 self ._view = view
132- # Connect signals, and slots
132+ # Connect signals and slots
133133 self ._connectSignals ()
134134
135135 def _calculateResult (self ):
@@ -146,7 +146,7 @@ def _buildExpression(self, sub_exp):
146146 self ._view .setDisplayText (expression )
147147
148148 def _connectSignals (self ):
149- """Connect signals, and slots."""
149+ """Connect signals and slots."""
150150 for btn_text , btn in self ._view .buttons .items ():
151151 if btn_text not in {"=" , "C" }:
152152 btn .clicked .connect (partial (self ._buildExpression , btn_text ))
@@ -164,7 +164,7 @@ def main():
164164 # Show the calculator's GUI
165165 view = PyCalcUi ()
166166 view .show ()
167- # Create an instance of the model, and the controller
167+ # Create an instance of the model and the controller
168168 model = evaluateExpression
169169 PyCalcCtrl (model = model , view = view )
170170 # Execute calculator's main loop
0 commit comments