Smoother practice experience (#306)
Co-authored-by: zhangzhen <zhangzhen@nao.cas.cn>
This commit is contained in:
parent
2eed0da5d9
commit
ad208750fa
@ -1,6 +1,6 @@
|
|||||||
import random
|
import random
|
||||||
import optparse
|
import optparse
|
||||||
|
import os
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Reads through README.md for question/answer pairs and adds them to a
|
"""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():
|
if options.skip and not answer.strip():
|
||||||
continue
|
continue
|
||||||
|
os.system("clear")
|
||||||
if input(f'Q: {question} ...Show answer? "y" for yes: ').lower() == 'y':
|
print(question)
|
||||||
|
print("...Press Enter to show answer...")
|
||||||
|
input()
|
||||||
print('A: ', answer)
|
print('A: ', answer)
|
||||||
|
print("... Press Enter to continue, Ctrl-C to exit")
|
||||||
|
input()
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user