How to use multicore python with PyQt4 process?

后端 未结 1 1400
日久生厌
日久生厌 2021-01-16 01:50

I am writing an app in pyqt4 that has to read in and parse a lot of xml files. Done single-threaded it takes a while to do all that parsing and make the thousands of python

相关标签:
1条回答
  • 2021-01-16 02:33
    • Spawn a QThread.
    • The QThread can farm out tasks to the multiprocessing Pool. You might use pool.apply_async() which has a callback parameter.
    • The callback parameter allows you to specify a function which is called when the target function completes.
    • The callback runs in the QThread, and is sent the return value of the target function as its one and only argument.
    • Each time the callback function runs, you can update the GUI to indicate the progress.
    0 讨论(0)
提交回复
热议问题