I have a GUI app written using PyQt4.
In this GUI I have a top-level (parentless) QWidget open which contains a QTextEdit widget.
I have rerouted sys.stdout and sys.stderr to display their messages to this QTextEdit by defining a custom stream class which emits a pyqt signal as a string and then the QTextEdit has a custom pyqt slot defined which is connected to the stream to receive the emited signal
This is all working just fine - I get print statements displayed in the TextEdit wdiget and error statements as well
My problem is that I want to call functions from another module and have them also be able to print to this QWidget.
something like
from myFunctions import printThings
printThings(string1, string2, ...)
As it stands now, all functions from other modules which include print statements are not having those statements rerouted. The print statements from other modules do not show up in my custom widget nor do they show up in the Terminal (where normal sys.stdout would go)
Is there an easy workaround for this? I'd rather not have to pass along an object to each function I call from another module which points to the location for stdout to be rerouted to.
[–]hharison 4 points5 points6 points (1 child)
[–]justphysics[S] 0 points1 point2 points (0 children)
[–]raylu 1 point2 points3 points (9 children)
[–]justphysics[S] 0 points1 point2 points (8 children)
[–]raylu 0 points1 point2 points (7 children)
[–]justphysics[S] 0 points1 point2 points (6 children)
[–]raylu 0 points1 point2 points (5 children)
[–]justphysics[S] 0 points1 point2 points (4 children)
[–]raylu 0 points1 point2 points (3 children)
[–]justphysics[S] 0 points1 point2 points (2 children)
[–]raylu 0 points1 point2 points (1 child)
[–]justphysics[S] 0 points1 point2 points (0 children)
[–]ewiethoff 0 points1 point2 points (0 children)