Skip to content

Commit b0cac15

Browse files
committed
Update some comments
1 parent de2d450 commit b0cac15

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pyqt-calculator-tutorial/pycalc/pycalc.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import sys
1616
from functools import partial
1717

18-
# 1. Import QApplication, and the required widgets from PyQt5.QtWidgets
18+
# Import QApplication, and the required widgets from PyQt5.QtWidgets
1919
from PyQt5.QtWidgets import QApplication
2020
from PyQt5.QtWidgets import QMainWindow
2121
from PyQt5.QtWidgets import QWidget
@@ -31,7 +31,7 @@
3131
ERROR_MSG = 'ERROR'
3232

3333

34-
# 2. Create a subclass of QMainWindow to setup the calculator's GUI
34+
# Create a subclass of QMainWindow to setup the calculator's GUI
3535
class PyCalcUi(QMainWindow):
3636
"""PyCalc's View (GUI)."""
3737

@@ -109,7 +109,7 @@ def clearDisplay(self):
109109
self.setDisplayText('')
110110

111111

112-
# 3. Create a Model to handle the calculator's operation
112+
# Create a Model to handle the calculator's operation
113113
def evaluateExpression(expression):
114114
"""Evaluate an expression."""
115115
try:
@@ -120,7 +120,7 @@ def evaluateExpression(expression):
120120
return result
121121

122122

123-
# 4. Create a Controller class to connect the GUI, and the model
123+
# Create a Controller class to connect the GUI, and the model
124124
class PyCalcCtrl:
125125
"""PyCalc's Controller."""
126126

@@ -158,15 +158,15 @@ def _connectSignals(self):
158158
# Client code
159159
def main():
160160
"""Main function."""
161-
# 5. Create an instance of `QApplication`
161+
# Create an instance of `QApplication`
162162
pycalc = QApplication(sys.argv)
163-
# 6. Show the calculator's GUI
163+
# Show the calculator's GUI
164164
view = PyCalcUi()
165165
view.show()
166-
# 7. Create an instance of the model, and the controller
166+
# Create an instance of the model, and the controller
167167
model = evaluateExpression
168168
PyCalcCtrl(model=model, view=view)
169-
# 8. Execute calculator's main loop
169+
# Execute calculator's main loop
170170
sys.exit(pycalc.exec_())
171171

172172

0 commit comments

Comments
 (0)