Posté le 20/08/2022 05:42
Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 96 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements
Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd
Citer : Posté le 20/08/2022 08:11 | #
I don't exactly understand how your solution works. If you run the for loop after the input() then you still have a blocking wait on the terminal for the user to type something. If you run it before the input() then pressing EXE does not pre-validate the input() AFAIK?
The only common trick for user input is to get the user to press AC/ON and then catch the KeyboardInterrupt. In Chute tridimensionnelle I extended the concept a bit further by using nested try/catch in a way that I can detect, single, double and triple AC/ON presses to represent two actions and an interrupt respectively. But you could also just wait for AC/ON to be pressed to run input() which switches to the terminal.
Citer : Posté le 20/08/2022 08:24 | #
I must have explained it badly, but it really does not matter, because you've solved it, and my hack is unnecessary. Now I can stay on the graphics screen until I choose to leave by pressing AC.
Thanks a lot!
“They call me the king of the spreadsheets, got 'em all printed out on my bedsheets.” — “Weird Al” Yankovic