I have some code which writes string output as HTML to a QTextBrowser:
def somefunc(self): area = 10.1 perimeter = 5.6 shape = \'someShape\'