import time import pygame if __name__=="__main__": pygame.init() pygame.joystick.init() joystick = pygame.joystick.Joystick(0) print(joystick.get_name()) while True: pygame.event.wait() a={ "leftx":joystick.get_axis(0), "lefty":joystick.get_axis(1), "rightx":joystick.get_axis(2), "righty":joystick.get_axis(3), "left_bj":joystick.get_axis(4), "right_bj":joystick.get_axis(5), } print(a)