def readin():
    'Reading from stdin and displaying menu'
    global positionrequest, ptz
    selection = sys.stdin.readline().strip('\n')
    lov = [x for x in selection.split(' ') if (x != '')]
    if lov:
        if (lov[0].lower() in ['u', 'up']):
            move_up(ptz, positionrequest)
        elif (lov[0].lower() in ['d', 'do', 'dow', 'down']):
            move_down(ptz, positionrequest)
        elif (lov[0].lower() in ['l', 'le', 'lef', 'left']):
            move_left(ptz, positionrequest)
        elif (lov[0].lower() in ['l', 'le', 'lef', 'left']):
            move_left(ptz, positionrequest)
        elif (lov[0].lower() in ['r', 'ri', 'rig', 'righ', 'right']):
            move_right(ptz, positionrequest)
        elif (lov[0].lower() in ['ul']):
            move_upleft(ptz, positionrequest)
        elif (lov[0].lower() in ['ur']):
            move_upright(ptz, positionrequest)
        elif (lov[0].lower() in ['dl']):
            move_downleft(ptz, positionrequest)
        elif (lov[0].lower() in ['dr']):
            move_downright(ptz, positionrequest)
        elif (lov[0].lower() in ['s', 'st', 'sto', 'stop']):
            ptz.Stop({'ProfileToken': positionrequest.ProfileToken})
            active = False
        else:
            print("What are you asking?\tI only know, 'up','down','left','right', 'ul' (up left), \n\t\t\t'ur' (up right), 'dl' (down left), 'dr' (down right) and 'stop'")
    print('')
    print('Your command: ', end='', flush=True)
Reading from stdin and displaying menu
def readin():
    
    global positionrequest, ptz
    selection = sys.stdin.readline().strip('\n')
    lov = [x for x in selection.split(' ') if (x != )]
    if lov:
        if (lov[0].lower() in ['u', 'up']):
            move_up(ptz, positionrequest)
        elif (lov[0].lower() in ['d', 'do', 'dow', 'down']):
            move_down(ptz, positionrequest)
        elif (lov[0].lower() in ['l', 'le', 'lef', 'left']):
            move_left(ptz, positionrequest)
        elif (lov[0].lower() in ['l', 'le', 'lef', 'left']):
            move_left(ptz, positionrequest)
        elif (lov[0].lower() in ['r', 'ri', 'rig', 'righ', 'right']):
            move_right(ptz, positionrequest)
        elif (lov[0].lower() in ['ul']):
            move_upleft(ptz, positionrequest)
        elif (lov[0].lower() in ['ur']):
            move_upright(ptz, positionrequest)
        elif (lov[0].lower() in ['dl']):
            move_downleft(ptz, positionrequest)
        elif (lov[0].lower() in ['dr']):
            move_downright(ptz, positionrequest)
        elif (lov[0].lower() in ['s', 'st', 'sto', 'stop']):
            ptz.Stop({'ProfileToken': positionrequest.ProfileToken})
            active = False
        else:
            print("What are you asking?\tI only know, 'up','down','left','right', 'ul' (up left), \n\t\t\t'ur' (up right), 'dl' (down left), 'dr' (down right) and 'stop'")
    print()
    print('Your command: ', end=, flush=True)