I wrote a crawler when I was learning python. That is, to capture the title, introduction, price, and buyer"s comments of some goods.
Today, I want to learn from pyqt5, so I want to add a gui to the reptile directly.
after running, the main form is unresponsive.
thinks it may be a crawler problem, which is too time-consuming.
so add a process to the button method in pyqt5.
when you click the button, open a new process to execute the crawler.
although the crawler works properly, the gui is still unresponsive.
I don"t understand what"s going on.
Thank you
class MyWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(MyWindow, self).__init__(parent)
self.setupUi(self)
self.pushButton_2.clicked.connect(self.aa)
def aa(self):
p = Process(target=pa)
p.start()
p.join()
if __name__ == "__main__":
app = QApplication(sys.argv)
m = MyWindow()
m.show()
sys.exit(app.exec_())