new_contents: #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  
  from PyQt5 import QtCore, QtNetwork
  import socket
  import signal
  
  class SignalWakeupHandler(QtNetwork.QAbstractSocket):
  
      def __init__(self, parent=None):
          super(SignalWakeupHandler, self).__init__(QtNetwork.QAbstractSocket.UdpSocket, parent)
          self.old_fd = None
          # Create a socket pair
          self.wsock, self.rsock = socket.socketpair(type=socket.SOCK_DGRAM)
          self.wsock.setblocking(0)
          # Let Qt listen on the one end
          self.setSocketDescriptor(self.rsock.fileno())
          # And let Python write on the other end
          self.old_fd = signal.set_wakeup_fd(self.wsock.fileno())
          # First Python code executed gets any exception from
          # the signal handler, so add a dummy handler first
          self.readyRead.connect(lambda : None)
          # Second handler does the real handling
          self.readyRead.connect(self._readSignal)
  
      def __del__(self):
          # Restore any old handler on deletion
          if self.old_fd is not None and signal and signal.set_wakeup_fd:
              signal.set_wakeup_fd(self.old_fd)
  
      def _readSignal(self):
          # Read the written byte.
          # Note: readyRead is blocked from occuring again until readData()
          # was called, so call it, even if you don't need the value.
          data = self.readData(1)
          # Emit a Qt signal for convenience
          self.signalReceived.emit(data[0])
  
      signalReceived = QtCore.pyqtSignal(int)
  
subject: exit work in progress...