python script does not wait for PyQt script

   2452   1   1
User Avatar
Member
1 posts
Joined: Feb. 2010
Offline
We have a python script that calls another pyqt python script. The idea is that the first module sets up some things, calls the GUI module to allow the user to input some values, and then processes the input. When run from a shell, this works fine. The calling script waits for the user to close the GUI and then processes the results. However, in Houdini when run as python code in a shelf, the calling script does not wait for the GUI to close and hence it starts processing the results from the GUI (there are none since the user hasn't done anything yet).

The GUI script detects whether it is running in Houdini or not so it knows whether to run QtGui.QApplication.exec_() or the exec_() method explained here: http://www.sidefx.com/docs/houdini10.0/hom/cookbook/pyqt/part1/. [sidefx.com] The difference in those methods is that the PyQt exec_() will block until the GUI is closed. The Houdini cookbook exec_() does not. I have tried a few hacks like spin loops, thread waits, and forks but all end up locking up Houdini.

In summary, we have a Houdini shelf that imports and runs a python module that in turn, imports and runs a pyqt application. I cannot find a way to have the calling python module wait for the pyqt application to close. This is on Houdini Escape v10.0.322 running on Red Hat Enterprise Linux 5. Any thoughts?
User Avatar
Member
1 posts
Joined: May 2016
Offline
Did you find a solution yet? I am having the same problem. Really anoying.
  • Quick Links