0

Do multiple things at once in Python?

How do you make python script that process more than one thing at once? For example, while waiting for user to put something in the input, countdown 10 seconds, if the user doesn’t respond in 10 seconds it will select default value.

1st May 2019, 1:34 PM
Nopparuj
Nopparuj - avatar
4 Respostas
+ 1
Well, this is absolutely possible with normal IDEs. But sololearn's IDE is not supporting dynamic inputs and it will throw a TimeOut error if it takes more time for execution
1st May 2019, 2:12 PM
Seniru
Seniru - avatar
0
Sεηιrυ ραsαη i meant what is it (multitasking) and where i can learn that, i know playground is not capable of doing that.
1st May 2019, 2:35 PM
Nopparuj
Nopparuj - avatar
0
Here's an attempt. Unfortunately, when the countdown reaches 0 and the user didn't enter anything, the pending input() seems to keep the thread alive so the user still needs to press return 🤔 https://code.sololearn.com/cRFV058HT9iT/?ref=app
1st May 2019, 2:56 PM
Anna
Anna - avatar