class XINPUT_VIBRATION(ctypes.Structure):
    _fields_ = [('wLeftMotorSpeed', ctypes.c_ushort), ('wRightMotorSpeed',
        ctypes.c_ushort)]
xinput = ctypes.windll.xinput1_1
XInputSetState = xinput.XInputSetState
XInputSetState.argtypes = [ctypes.c_uint, ctypes.POINTER(XINPUT_VIBRATION)]
XInputSetState.restype = ctypes.c_uint
vibration = XINPUT_VIBRATION(65535, 32768)
XInputSetState(0, ctypes.byref(vibration))

def set_vibration(controller, left_motor, right_motor):
    vibration = XINPUT_VIBRATION(int(left_motor * 65535), int(right_motor *
        65535))
Is it possible to "rumble" a Xbox 360 controller with Python?