Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Pyside + Requests + Multiprocessing ... strange behavior

$
0
0
Hi, I need some help about this script. When I Execute it in IPython, the first call to do_cmd() is ok. But when I call do_cmd() from the QPushButton event() the function hangs …. Can you try this on your setup please ? Just to see if it is related to my config/setup ? Thanks ! import multiprocessing import requests   def run_and_wait():     for i in range(10):         print 'Turn #%i' % i         requests.get('http://google.com')         print 'Turn #%i done' % i     print 'End'   def do_cmd():     process = multiprocessing.Process(target=run_and_wait)     process.start()     process.join()     #from here it works do_cmd()   from PySide.QtGui import QApplication, QPushButton app = QApplication([]) button = QPushButton('Do') #from here it does not work button.clicked.connect(do_cmd) button.show() app.exec_() (To install requests : pip install requests)

Viewing all articles
Browse latest Browse all 13965

Trending Articles