PyQt4 Wait in thread for user input from GUI

I have a thread class “MyThread” and my main application which is simply called “Gui”. I want to create a few objects from the thread class but for this example I created only one object. The thread class does some work, then emits a signal to the Gui class, indicating that a user input is needed (this indication for now is simply changing the text of a button). Then the thread should wait for a user input (in this case a button click) and then continue doing what it is doing…

How to capture output of Python’s interpreter and show in a Text widget?

I have a program in Python with PyQt, designed to run on Windows.
This program makes a lot of operations and prints a lot of info.
But as I want to freeze it and don’t want the prompt screen to appear, I want that all that info appears in the main application, in a QTextEdit or so.
How can i make the program work so it gets the output from the interpreter and shows it on the textEdit at the same time, just like it does on the real interpreter?