lundi 19 octobre 2020

How to stop program without exiting it

I want to build my own reading speed test where I ask the user to start and stop a timer. When the user starts, or presses "s" on their keyboard, I need to start the timer and print something like

From the corner of the divan of Persian saddle-bags on which he was lying, smoking, as was his custom,
innumerable cigarettes, Lord Henry Wotton could just catch the gleam of the honey-sweet and honey-coloured 
blossoms of a laburnum, whose tremulous branches seemed hardly able to bear the burden of a beauty so 
flamelike as theirs

I want to print out that certain text until a certain key is pressed. Preferably 'q'. When 'q' is pressed, I want to end the timer and remove the text.

How can I go about doing this?

Aucun commentaire:

Enregistrer un commentaire