I have adapted the "async def _read_stream (stream, cb):" code described in How can I run an external command asynchronously from Python? by adding the update of a QTextEdit widget but the process is blocking when appending a text to the widget.
async def _read_stream(widget:RunCampaignWidget, stream, cb):
while True:
line = await stream.readline()
if line:
#cb(line)
print("_read_stream :: line = " + str(line))
widget.__run_result_console.append(line)
widget.__run_result_console.show()
global log_lines
log_lines += str(line)
#print("_read_stream :: log_lines = " + log_lines)
else:
break
In fact, I cannot update the GUI while running an asynchronous process. Any idea?