diff --git a/2017_3_30/calculator.py b/2017_3_30/calculator.py
deleted file mode 100644
index a2dfefae61fbc84dba3104befa5cf116d23e3247..0000000000000000000000000000000000000000
--- a/2017_3_30/calculator.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import sys
-from PyQt5 import uic
-from PyQt5.QtWidgets import QApplication,QMainWindow
-
-
-
-class Calc(QMainWindow):
- def __init__(self):
- QMainWindow.__init__(self)
- uic.loadUi('calculator.ui',self)
-
-
-if __name__ == '__main__':
- app = QApplication(['calculator.py'])
- calc = Calc()
- calc.show()
- app.exec_()
\ No newline at end of file
diff --git a/2017_3_30/calculator.ui b/2017_3_30/calculator.ui
deleted file mode 100644
index 7df6de973f926a192133b8b68064ec2d5ea1ccba..0000000000000000000000000000000000000000
--- a/2017_3_30/calculator.ui
+++ /dev/null
@@ -1,631 +0,0 @@
-
-
- MainWindow
-
-
-
- 0
- 0
- 334
- 314
-
-
-
-
- 10
- 0
-
-
-
-
- 800
- 800
-
-
-
- MainWindow
-
-
-
-
-
- 50
- 170
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 1
-
-
-
- 50
- 50
-
-
-
-
-
-
- 100
- 170
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
-
- 50
- 50
-
-
-
-
- 50
- 50
-
-
-
- 2
-
-
-
- 50
- 50
-
-
-
-
-
-
- 150
- 170
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 3
-
-
-
- 50
- 50
-
-
-
-
-
-
- 50
- 120
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 4
-
-
-
- 50
- 50
-
-
-
-
-
-
- 100
- 120
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 5
-
-
-
- 50
- 50
-
-
-
-
-
-
- 150
- 120
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 6
-
-
-
- 50
- 50
-
-
-
-
-
-
- 50
- 70
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 7
-
-
-
- 50
- 50
-
-
-
-
-
-
- 100
- 70
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 8
-
-
-
- 50
- 50
-
-
-
-
-
-
- 150
- 70
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- 9
-
-
-
- 50
- 50
-
-
-
-
-
-
- 50
- 220
- 91
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 800
- 800
-
-
-
- 0
-
-
-
- 50
- 50
-
-
-
-
-
-
- 150
- 220
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- .
-
-
-
- 50
- 50
-
-
-
-
-
-
- 200
- 220
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- +
-
-
-
- 50
- 50
-
-
-
-
-
-
- 200
- 170
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- -
-
-
-
- 50
- 50
-
-
-
-
-
-
- 200
- 120
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- *
-
-
-
- 50
- 50
-
-
-
-
-
-
- 200
- 70
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- /
-
-
-
- 50
- 50
-
-
-
-
-
-
- 250
- 170
- 41
- 91
-
-
-
-
- 10
- 10
-
-
-
-
- 100
- 100
-
-
-
- =
-
-
-
- 50
- 50
-
-
-
-
-
-
- 250
- 120
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- %
-
-
-
- 50
- 50
-
-
-
-
-
-
- 250
- 70
- 41
- 41
-
-
-
-
- 10
- 10
-
-
-
-
- 50
- 50
-
-
-
- C
-
-
-
- 50
- 50
-
-
-
-
-
-
- 50
- 20
- 241
- 51
-
-
-
-
-
-
-
-
- 800
- 800
-
-
-
-
-
-
-
diff --git a/calc.py b/calc.py
index b9ecbd51f819d75746ebc3f9306ddc480704233e..aa11120bf9a8af9acd66a9a155a999a31856b9f6 100644
--- a/calc.py
+++ b/calc.py
@@ -1,3 +1,4 @@
+#coding:utf-8
import sys
from PyQt5 import uic
from PyQt5.QtWidgets import QApplication
@@ -7,13 +8,60 @@ class Calc(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
uic.loadUi('calc.ui',self)
-
-
-
-
+ self.pushButton0.clicked.connect(self.a)
+ self.pushButton1.clicked.connect(self.b)
+ self.pushButton2.clicked.connect(self.c)
+ self.pushButton3.clicked.connect(self.d)
+ self.pushButton4.clicked.connect(self.e)
+ self.pushButton5.clicked.connect(self.f)
+ self.pushButton6.clicked.connect(self.g)
+ self.pushButton7.clicked.connect(self.h)
+ self.pushButton8.clicked.connect(self.k)
+ self.pushButton9.clicked.connect(self.m)
+ self.pushButton_clear.clicked.connect(self.calc_clear)
+ self.pushButton_add.clicked.connect(self.calc_add)
+ self.pushButton_sub.clicked.connect(self.calc_sub)
+ self.pushButton_div.clicked.connect(self.calc_div)
+ self.pushButton_mul.clicked.connect(self.calc_mul)
+ self.pushButton_dot.clicked.connect(self.calc_dot)
+ self.pushButton_equal.clicked.connect(self.calc_equal)
+
+ def a(self):
+ print '我被点击了0'
+ def b(self):
+ print '我被点击了1'
+ def c(self):
+ print '我被点击了2'
+ def d(self):
+ print '我被点击了3'
+ def e(self):
+ print '我被点击了4'
+ def f(self):
+ print '我被点击了5'
+ def g(self):
+ print '我被点击了6'
+ def h(self):
+ print '我被点击了7'
+ def k(self):
+ print '我被点击了8'
+ def m(self):
+ print '我被点击了9'
+ def calc_add(self):
+ print '我被点击了add===='
+ def calc_sub(self):
+ print '我被点击了sub===='
+ def calc_div(self):
+ print '我被点击了div==='
+ def calc_mul(self):
+ print '我被点击了mul==='
+ def calc_equal(self):
+ print '我被点击了equal==='
+ def calc_dot(self):
+ print '我被点击了dot==='
+ def calc_clear(self):
+ print '我被点击了clear==='
if __name__ == '__main__':
app = QApplication(sys.argv)
- print help(QApplication)
calc = Calc()
calc.show()
app.exec_()
diff --git a/calc.ui b/calc.ui
index 5b653a6f94f351a367f92f37dc3e259e151999c6..69d1b645a96260523bfc75d47a19598889e9678e 100644
--- a/calc.ui
+++ b/calc.ui
@@ -232,7 +232,7 @@
.
-
+
150
@@ -252,7 +252,7 @@
+
-
+
150
@@ -272,7 +272,7 @@
-
-
+
150
@@ -292,7 +292,7 @@
*
-
+
150