How add text without new line in QTextEdit PyQt4 Python 2.7?
问题 I have problem with add text without new line in QTextEdit. I must add the value of variable "self.value" and next text ", word" It's my code: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class Text(QWidget): def __init__(self, parent = None): super(Text, self).__init__(parent) self.value = 5 layout = QHBoxLayout() self.text_edit = QTextEdit() self.text_edit.append(str(self.value)) self.text_edit.append(", word") layout.addWidget(self.text_edit) self.setLayout(layout) self