python - PyQt Thread not running -


i trying run long running test suite background thread pyqt. on osx thread never runs, on windows thread runs if include print statement after starting thread. code looks this:

def runmoduletests(self):     self.stackedwidget.setcurrentindex(2)      self.testthread = qtcore.qthread()     tr = testrunner(self.on_testresult, self.modulearticlenumber, self.moduleserialnumber, self.testbedarticlenumber)     tr.movetothread(self.testthread)     tr.testfinished.connect(self.testthread.quit)     self.testthread.started.connect(tr.runmoduletests)     self.testthread.start()     print "this print out here make threads work.  ugly hack!" 

i have these questions:

  • is print statement causing gui yield on windows, other thread starts?
  • how can thread start on both mac osx , windows?
  • does gil mean cannot responsive ui using pyqt?
  • am doing things wrong way?

i have taken inspiration answer question: background thread qthread in pyqt

the comment @zaiborg missing. need keep handle on object if move thread.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -