title: What would be the best way to handle a serial disconnect?
body: <p>Ideally I would like to call a function when the USB port is disconnected while open, but I can't find if such thing is possible. While my python program runs, its opens up serial port <code>self._serial = serial.Serial(self._serialPort, 9600, timeout=1)</code> where <code>self._port = '/dev/tty.usbserial-FTBNNWBM'</code> when the device is disconnected nothing happens, until the program tries to send a command and fails.</p>
  <p>I would like to be able to call <code>disconnectHandler()</code> when the device is disconnected.</p>