I want my output to appear in my pyqt textedit not python shell after clicking a pushbutton. I am not familiar with subprocess or stdout stuff and not even sure if this will involve them. Need some help here. Here is part of my code:
self.textEdit = QtGui.QTextEdit(Dialog)
self.textEdit.setGeometry(QtCore.QRect(20, 200, 431, 241))
self.textEdit.setObjectName(_fromUtf8("textEdit"))
def readI2C(self):
data = i2c.read_byte(0x50)
return data
self.textEdit.setText(data)
This code does not print anything. I tried it with print data
but this prints result in python shell. Anyone can help?