self.button = QtGui.QPushButton('Test')
self.edit = QtGui.QTextEdit()
layout.addWidget(self.edit)
layout.addWidget(self.button)
self.button.clicked.connect(self.handleTest)

def handleTest(self):
    self.edit.append('spam: spam spam spam spam')
if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
win = Window()
win.show()
sys.exit(app.exec_())
Add more than one line to a QTextEdit PyQt