标签:import bsp from elf except nec ted button http
1 # -*- coding:utf-8 -*- 2 ‘‘‘ 3 Created on Sep 14, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ‘‘‘ 9 import sys 10 from PyQt5.QtWidgets import QApplication,QInputDialog,QLineEdit,QPushButton,QWidget 11 12 class New_test(QWidget): 13 def __init__(self): 14 super().__init__() 15 self.initUI() 16 17 def initUI(self): 18 self.btn = QPushButton(‘Diaglog‘,self) 19 self.btn.move(20,20) 20 self.btn.clicked.connect(self.showDiaglog) 21 22 self.le = QLineEdit() 23 self.le.move(130,22) 24 25 self.setGeometry(300,300,290,150) 26 self.setWindowTitle(‘Input Diaglog‘) 27 self.show() 28 29 def showDiaglog(self): 30 try: 31 text,ok = QInputDialog.getText(self,‘Input Diaglog‘,‘Enter your name‘) 32 if ok: 33 self.le.setText(str(text)) 34 except Exception as e: 35 print (e) 36 37 if __name__ == ‘__main__‘: 38 app = QApplication(sys.argv) 39 ex = New_test() 40 sys.exit(app.exec_())
标签:import bsp from elf except nec ted button http
原文地址:https://www.cnblogs.com/SaShuangYiBing/p/9648079.html