Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pyqt log widget thread safe

class QTextEditLogger(logging.Handler, QtCore.QObject):
    appendPlainText = QtCore.pyqtSignal(str)

def __init__(self, parent):
    super().__init__()
    QtCore.QObject.__init__(self)
    self.widget = QtWidgets.QPlainTextEdit(parent)
    self.widget.setReadOnly(True)
    self.appendPlainText.connect(self.widget.appendPlainText)

def emit(self, record):
    msg = self.format(record)
    self.appendPlainText.emit(msg)
Comment

PREVIOUS NEXT
Code Example
Python :: NumPy unique Example Identify the index of the first occurrence of unique values 
Python :: NumPy rot90 Example Rotating Three times 
Python :: what are while loops in python 
Python :: program adxl335 python 
Python :: track keyboard press pynput 
Python :: how to increment date in python 
Python :: NumPy bitwise_xor Code When inputs are numbers 
Python :: NumPy unpackbits Code Unpacked array along axis 1 
Python :: django view - apiview decorator (retrieve, update or delete - GET, PUT, DELETE) 
Python :: free konta mc 
Python :: How to run a method before/after all class function calls with arguments passed? 
Python :: downgrading to previous migration django 
Python :: python truncade number 
Python :: create loop python 
Python :: ccacxc 
Python :: combination in python without itertools 
Python :: django.db.utils.ProgrammingError: (1146 
Python :: python re return index of match 
Python :: how do i add two matrix and store it in a list in python 
Python :: how to click button and download a file using robot frame work or selenium, it not contains link 
Python :: socialscan 
Python :: Invenco Order Dict 
Python :: ring for loop 
Python :: python print replace old print 
Python :: create schema for table for django 
Python :: Uso de lambda 
Python :: python message from byte 
Python :: dataframe from function 
Python :: phone no validate 
Python :: opencv houghlines only horizontal 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =