0

I m trying to pipe my output to text browser of pyqt. right now i m creating a class having only write method.

class port:
    def __init__(self,view):
        self.view = view

    def write(self,*args):
        self.view.append(*args)

then just

text_browser = QTextBrowser()
sys.stdout = port(text_browser)

this works fine but is there a better way ? and also for the AttributeError: 'port' object has no attribute 'flush'i have to create a flush method which does nothing , so could there be a cleaner way?

GIRISH RAMNANI
  • 614
  • 6
  • 18

0 Answers0