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:
- Python asynchronous execution library asyncio
- Python next() stopiteration error [How to Solve]
- Python raspberry pie starts sending IP address to mailbox
- Python: RNN principle realized by numpy
- How to Solve RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu
- [Solved] error: when using the property decorator in Python, an error occurs: typeerror: descriptor ‘setter’ requires a ‘property’ object but
- python: File Processing and Input and Output
- Python USES the PO design pattern for automated testing
- [Solved] TypeError: not all arguments converted during string formatting
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- Failed to establish a new connection: [winerror 10048] in the requests thread pool, the interface is called circularly to get the datagram error
- [example multitasking] Python multithreading module
- Parallel processing in Python (Pool.map(), Pool.starmap(), Pool.apply ())
- [Solved] Pytorch-transformers Error: AttributeError: ‘str‘ object has no attribute ‘shape‘
- [ONNXRuntimeError] : 10 : INVALID_Graph loading model error
- Python: How to Create an Automatic Recording Program
- Python reads excel and stores it in the list according to the header hash copy.deepcopy
- Python traverses all files under the specified path and retrieves them according to the time interval
- [Solved] MindSpore Error: “operation does not support the type kMetaTypeNone“
- Python error: urllib.error.HTTPError : http Error 404: not found