def answerYes(): input.clearPressBuffer(ord('Y')) input.clearPressBuffer(ord('N')) while True: if input.wasPressedSinceLast(ord('Y')): return True if input.wasPressedSinceLast(ord('N')): return False sleep(0.1)
def clearInput(): for k in (input.DOWN, input.LEFT, input.RIGHT, input.PRIOR, input.NEXT, input.UP, ord('N'), ord('L'), ord('P'), ord('Y')): input.clearPressBuffer(k)