From ad208750fa3507944a4d19b28ec39eb229ea9e2d Mon Sep 17 00:00:00 2001 From: MengDanzz <95761983+MengDanzz@users.noreply.github.com> Date: Sun, 6 Nov 2022 15:58:03 +0800 Subject: [PATCH] Smoother practice experience (#306) Co-authored-by: zhangzhen --- scripts/random_question.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/random_question.py b/scripts/random_question.py index a0e2b7e..7bf7438 100644 --- a/scripts/random_question.py +++ b/scripts/random_question.py @@ -1,6 +1,6 @@ import random import optparse - +import os def main(): """Reads through README.md for question/answer pairs and adds them to a @@ -39,9 +39,13 @@ def main(): if options.skip and not answer.strip(): continue - - if input(f'Q: {question} ...Show answer? "y" for yes: ').lower() == 'y': - print('A: ', answer) + os.system("clear") + print(question) + print("...Press Enter to show answer...") + input() + print('A: ', answer) + print("... Press Enter to continue, Ctrl-C to exit") + input() except KeyboardInterrupt: break