import bge

def main():
    dict = bge.logic.globalDict #Get the global dictionary
    if bge.logic.joysticks[0] == None:
        dict['joy_1'] = True
    else:
        dict['joy_1'] = False 
    if bge.logic.joysticks[1] == None:
        dict['joy_2'] = True
    else:
        dict['joy_2'] = False           

main()
