
error pyside
Publicado por pyside (6 intervenciones) el 25/03/2015 17:15:30
Error en la fila 17. He probado con la tabulación pero persiste el error. ¿Algún consejo?
Gracias.
Gracias.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# coding=utf-8
import sys
from PySide import QtGui, QtCore
def botoClic():
mp =float('Inf')
mg =float('-Inf')
text, ok = QtGui.QInputDialog.getText(wid, 'n?', "Dona'm un número:")
n = float(text)
while n != 0:
if n > mg:
mg = n
if n < mp:
mp = n
text, ok = QtGui.QInputDialog.getText(wid, 'n?', "Dona'm un número:")
n = float(text)
wid.resultado.setText(str(mp)+" "+str(mg))
app = QtGui.QApplication(sys.argv)
wid = QtGui.QWidget()
text, ok = QtGui.QInputDialog.getText(wid, 'n?', "Dona'm un número:")
n = float(text)
wid.resultado = QtGui.QLabel()
formulario = QtGui.QGridLayout()
formulario.addWidget(wid.boto, 1, 1)
formulario.addWidget(wid.resultado, 3, 1)
wid.resize(250, 150)
wid.move(300, 200)
wid.setWindowTitle("serie")
wid.setLayout(formulario)
wid.caja1.setFocus()
QtCore.QObject.connect(wid.boto, QtCore.SIGNAL('clicked()'), botoClic)
wid.show()
sys.exit(app.exec_())
Valora esta pregunta


0