def key_unit(key, period):
    cmd_time_cost = 0.21
    to_delay = (period - cmd_time_cost)
    if (to_delay > 0):
        keyDown(key)
        delay((period - 0.203))
        keyUp(key)
    else:
        keyDown(key)
        keyUp(key)
def key_unit(key, period):
    cmd_time_cost = 0.21
    to_delay = (period - cmd_time_cost)
    if (to_delay > 0):
        keyDown(key)
        delay((period - 0.203))
        keyUp(key)
    else:
        keyDown(key)
        keyUp(key)