From b0e2b01e00aa4e080f9429ffd7052a495fd81b8e Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 9 Mar 2019 14:11:53 -0700 Subject: [PATCH] Added beep function * Fixes issue #89 --- .bin/Scripts/functions/common.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.bin/Scripts/functions/common.py b/.bin/Scripts/functions/common.py index a352f9d6..7efaeac3 100644 --- a/.bin/Scripts/functions/common.py +++ b/.bin/Scripts/functions/common.py @@ -115,6 +115,14 @@ def ask(prompt='Kotaero!'): return answer +def beep(repeat=1): + """Play system bell with optional repeat.""" + for i in range(repeat): + # Print bell char + print('\a') + sleep(0.5) + + def choice(choices, prompt='Kotaero!'): """Prompt the user with a choice question, returns str.""" answer = None