In my pyqt gui there is a button that, when clicked, launches a function that performs several lengthy mathematical calculations. Inside this function there were many print statements, such as:
print "finished calculating task1 going on to task2"
Thus, using print instructions similar to what I did not need to indicate, for example, a progress indicator to indicate program progress. I added a QTextEdit widget to my gui and replaced all print statements in this function:
MyTextEdit.append('message')
where MyTextEdit is a QTextEdit widget and message is the message I would like to print.
Example:
MyTextEdit.append('finished calculating task1 going on to task2') task2
When I press the button and the function starts, all calculations inside this function should end, and then all messages are added to the QTextEdit widget.
I thought that every time MyTextEdit.append('message') is executed, it starts immediately and the widget will display the message at the very moment, and not at the end for all other messages.
What am I doing wrong?
I had an idea to do this by reading this post.
source share