'Method to handle what to do when the stop button is pressed'

@Slot()
def stop_button_click_handler(self):

    self.stop_button.setDisabled(True)
    if (not self.shellwidget._reading):
        self.interrupt_kernel()
    else:
        self.shellwidget.write_to_stdin('exit')
