上个图~
index.py 文件
1 # -*- coding: utf-8 -*- 2 from PyQt5 import QtWidgets,QtCore #从pyqt库导入QtWindget通用窗口类 3 from form import Ui_form 4 from url import Url 5 import chardet 6 import json 7 from PyQt5.QtWidgets import (QWidget,QTableWidget,QHBoxLayout,QApplication,QDesktopWidget,QTableWidgetItem,QHeaderView) 8 9 class mywindow(QtWidgets.QWidget,Ui_form): #自己建的类,继承QtWidgets.Qwidget类方法和Ui_Form界面类 10 11 _signal = QtCore.pyqtSignal(list,tuple,str) #定义信号,定义参数类型为str 12 13 def __init__(self): 14 super(mywindow,self).__init__() #首先找到子类(mywindow)的父类(QWidget),然后把my的对象self转成QWidget的对象,然后被转化的self调用自己的init函数 15 self.setupUi(self) #直接继承界面类,调用类的setupUi方法 16 17 self.submit.clicked.connect(self.mySubmit) #连接自己的槽函数 18 self._signal.connect(self.myPrint) #将信号连接到函数mySignal 19 20 def mySubmit(self): #自定义的槽函数。槽其实就是个函数(方法) 21 text = self.url.text() #获取值 22 #combox = self.type.currentText() #获取复选框的值 23 tbtext = self.tb1.toPlainText() #获取输入框的值 24 tbtext = tbtext.split('\n') #根据换行符 截断 25 bdtext = self.bd.toPlainText() 26 new=Url(text,tbtext,bdtext) #发送给url文件,调用发请求的函数 27 choose = self.tp.currentText() 28 if choose == 'GET': 29 #print('get lo~') 30 result = new.get() 31 else: 32 #print(