I have to loop over a bunch of different chunks and run expensive tasks in a script. I'd like a way to see which one I'm on, so I was hoping to open a little PyQt widget that displays the current chunk and a progress bar. Unfortunately, once I launch my gui, it seems like it blocks the drawing of both agisoft and my ui. Here's the abbreviated version of what I'm running:
class MyWidget (QtGui.QWidget):
# Define the behavior here
def setCurrentChunk( self, chunkNumber ):
# Do some stuff
def doIt():
win = MyWidget()
win.show()
for i in range(0,4):
win.setCurrentChunk( i )
print("Running %d"%i)
time.sleep(5)
Unfortunately, my window updates sporadically and the print statements don't show up in the agisoft console until after the whole loop is done.
I know python isn't truly threaded, but is there a way that you've found to launch a gui that won't block draws? I really don't want to have to write a separate program that communicates over sockets just for a progress bar.
Thanks!