def signal_handler(sig, frame):
    """Helper method to shutdown the RedBot if Ctrl-c is pressed"""
    print('\nYou pressed Ctrl+C')
    if board is not None:
        board.send_reset()
        board.shutdown()
    sys.exit(0)
def signal_handler ( sig , frame ) : print ( '\nYou pressed Ctrl+C' ) if board is not None : board . send_reset ( ) board . shutdown ( ) sys . exit ( 0 )
Helper method to shutdown the RedBot if Ctrl-c is pressed