Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Pyside + Requests + Multiprocessing ... strange behavior
Qt 6.11 is out! See what's new in the release blog

Pyside + Requests + Multiprocessing ... strange behavior

Scheduled Pinned Locked Moved Language Bindings
1 Posts 1 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sewfr
    wrote on last edited by
    #1

    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)

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved