After redirecting the command line output to the UI interface in the previous article, an error will be reported when closing the UI interface
Has no attribute of flush in Python or
PyQt: RuntimeError: wrapped C/C++ object has been deleted
The solution is to add a function in the class to which the command line output is redirected:
class ButtonOne(QThread):
_signalForText = pyqtSignal(str)
def __init__(self):
super(ButtonOne, self).__init__()
def write(self, text):
self.signalForText.emit(text)
def run(self):
for i in range(15):
time.sleep(1)
print(i)
print('end')
@property
def signalForText(self):
return self._signalForText
def flush(self):
pass
This can be solved.
The added functions are:
def flush(self):
pass
Read More:
- [Solved] Python 3.6 Error: ‘dict’ object has no attribute ‘has_key’
- [Modified] AttributeError: ‘socket‘ object has no attribute ‘ioctl‘ python linux
- How to Solve Python AttributeError: ‘dict’ object has no attribute ‘item’
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]
- [2021-10-05] Python Error: AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- Python Openyxl Error: AttributeError: ‘int‘ object has no attribute ‘upper‘ [How to Solve]
- [Solved] Python Keras Error: AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- [Solved] Selenium python send_key error: list object has no attribute
- [Solved] python Error: AttributeError: ‘NoneType‘ object has no attribute ‘split‘
- Python writes DICOM file (attributeerror: ‘filemetadataset’ object has no attribute ‘transfersyntax uid’ solution)
- [Solved] Python Selenium Error: AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- [Solved] Operator Not Allowed In Graph Error & Attribute Error Tensor object has no attribute numpy
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- AttributeError: DatetimeProperties object has no attribute
- [Solved] AttributeError: ‘DataFrame‘ object has no attribute ‘tolist‘
- Djangorestframework-simplejwt: ‘str‘ object has no attribute ‘decode‘ [Solved]
- [Solved] AttributeError: ‘DataFrame‘ object has no attribute ‘map‘
- [Solved] Pytorch-transformers Error: AttributeError: ‘str‘ object has no attribute ‘shape‘