Professional Documents
Culture Documents
App
App
App
def __init__(self):
QtGui.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
self.setupUi(self)
self.value_x.setFocus()
self.connect(self.value_x,QtCore.SIGNAL('returnPressed()'),self.Calcular)
self.Calculate.clicked.connect(self.Calcular)
def Calcular(self):
a=float(self.value_a.toPlainText())
b=float(self.value_b.toPlainText())
x=float(self.value_x.text())
y=a*x+b
self.result_y.setText(str(y))
if __name__ == '__main__':
app=QtGui.QApplication(sys.argv)
window=App()
window.show()
sys.exit(app.exec_())