This is probably very basic, but it's giving me a headache, and I'm not sure what method to even approach it with, making the googling tough.
If I have a class in a module that I'm importing with various prints throughout, how can I read the prints as they come so that I may output them to a PyQT text label?
class Worker(QtCore.QThread, object):
class statusWrapper(object):
def __init__(self, outwidget):
self.widget = outwidget
def write(self, s):
self.widget.setText(s)
def __init__(self, widget):
QtCore.QThread.__init__(self)
sys.stdout = statusWrapper(widget)
def run(self):
self.runModule() #This is the module with the prints within.
Something mysterious gets passed to the statusWrapper.write when runModule gets executed, but it's blank. What am I doing wrong?
Thanks.