0
def print_1():
    ... (some codes)
    print("from print_1 - 1")
    ...
    print("from print_1 - 2")

def print_2():
    ...
    print("from print_2 - 1")
    ...
    print("from print_2 - 2")

I have above two functions that print some texts. And I want to print texts from print_1 to QTextBrowser_1 and texts from print_2 to QTextBrowser_2. How can I link print function with QTextBrowser?

  • While technically doable, it's not suggested to do that, as in order to achieve it the result is that *any* output would be appended to the text editor: if, for some reason, the program outputs *lots* of text due to internal debugging output, you'll get a lot of unnecessary noise. Just use `setPlainText()`. – musicamante Jan 18 '22 at 19:00

0 Answers0