пишу протенкую программу на питон 3,4,4i
import sys
import math
from PyQt4 import QtGui
from PyQt4 import QtCore
class Pifagor(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent=None)
self.setGeometry(400, 400, 300, 250)
self.setWindowTitle('')
self.al = QtGui.QLineEdit(self)
self.al.setGeometry(10, 30, 80, 20 )
self.bl = QtGui.QLineEdit(self)
self.bl.setGeometry(10, 70, 80, 20)
self.cl = QtGui.QLineEdit(self)
self.cl.setGeometry(10, 110, 80, 20)
self.la = QtGui.QLabel("lages 1", self)
self.lb = QtGui.QLabel("lages 2", self)
self.lc = QtGui.QLabel("hypotenuse", self)
self.la.setGeometry(10, 10, 80, 20)
self.lb.setGeometry(10, 50, 80, 20)
self.lc.setGeometry(10, 90, 80, 20)
self.go = QtGui.QPushButton('Go', self)
self.go.setGeometry(10, 200, 40, 40)
self.connect(self.go,QtCore.SIGNAL("clicked()"),self.pifagor)
self.pole = QtGui.QPlainTextEdit(self)
self.pole.setGeometry(100, 20, 190, 160)
self.close = QtGui.QPushButton('Close', self)
self.close.setGeometry(250, 200, 40, 40)
self.connect(self.close, QtCore.SIGNAL ( "clicked () "), QtGui.qApp, QtCore.SLOT('quit()'))
self.what = ("?")
def pifagor (self):
b = float(self.bl.text())
c = float(self.cl.text())
a = float(self.al.text())
if (self.al.text() == self.what):
kat1 = math.sqrt((c ** int('2')) - (b ** int('2'))
self.pole.setPlainText("Lages1=" + str(kat1))
elif (self.bl.text() == self.what):
kat2 = math.sqrt((c ** int('2')) - (a ** int('2'))
self.pole.setPlainText("Lages2=" + str(kat2))
elif (self.cl.text() == self.what):
hip = math.sqrt((b ** int('2')) + (a ** int('2'))
self.pole.setPlainText("hypotenuse=" + str(hip))
else:
self.pole.setPlainText("Ok")
app = QtGui.QApplication(sys.argv)
icon = Pifagor()
icon.show()
app.exec_()
при запуске выдает ошибку:
self.pole.setPlainText("Lages1=" + str(kat1))
^
invalid syntax
помогите пожалуйста