pygame.joystick.quit()
pygame.joystick.init()
joystick_count = pygame.joystick.get_count()
for i in range(joystick_count):
    joystick = pygame.joystick.Joystick(i)
joystick.init()
if not joystick_count:
    if not discon:
        print('reconnect you meat bag')
discon = True
clock.tick(20)
check_pad()
pygame: detect Joystick disconnect, and wait for it to be reconnected