rendered paste body# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'form1.ui'## Created: dom sep 30 18:11:51 2007# by: The PyQt User Interface Compiler (pyuic) 3.17.3## WARNING! All changes made in this file will be lost!from qt import *class Form1(QDialog): def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) if not name: self.setName("Form1") self.lineEdit1 = QLineEdit(self,"lineEdit1") self.lineEdit1.setGeometry(QRect(10,240,125,26)) self.pushButton1 = QPushButton(self,"pushButton1") self.pushButton1.setGeometry(QRect(160,240,112,29)) self.textLabel1 = QLabel(self,"textLabel1") self.textLabel1.setGeometry(QRect(20,220,69,20)) self.textLabel2 = QLabel(self,"textLabel2") self.textLabel2.setGeometry(QRect(20,10,69,20)) self.listBox1 = QListBox(self,"listBox1") self.listBox1.setGeometry(QRect(10,30,106,180)) self.languageChange() self.resize(QSize(292,289).expandedTo(self.minimumSizeHint())) self.clearWState(Qt.WState_Polished) self.connect(self.pushButton1,SIGNAL("clicked()"),self.tablas) def languageChange(self): self.setCaption(self.__tr("Form1")) self.pushButton1.setText(self.__tr("aceptar")) self.textLabel1.setText(self.__tr("Valor")) self.textLabel2.setText(self.__tr("Resultado")) def tablas(self): self.listBox1.clear() # cargar lo tipeado en lineedit e = self.lineEdit1.text().ascii() for i in range(1,11): texto="%i x %i = %i" %(i,int(e), i*int(e)) self.listBox1.insertItem(texto) self.lineEdit1.clear() def __tr(self,s,c = None): return qApp.translate("Form1",s,c)from qt import *from form1 import *import sysif __name__ == "__main__": app = QApplication(sys.argv) f = Form1() f.show() app.setMainWidget(f) app.exec_loop()