Suppose I have an interface like this consisting of GtkTextView and a button.
And I have code like this:
print "Sample Message"
if __name__ == "__main__":
Here on_ok function is the handler for the button. Now what i want is that whenever the print statement is executed, i want it's output redirected to the textview. I know that I can use GtkTextBuffer and using set_buffer() I can achieve my objective. But i want the stdout to be redirected since I'm dealing with a proprietary library of python which sends all it's output to stdout.