+ 2

Multiple function at same time python

i want to make program that saying this: in count 10, you need to input the answer correctly. so after the count 10 finished,it will exit().how to do that? im confuse because the input() function will wait for input,no matter if the time is up.

24th Jul 2017, 1:42 PM
Kevin AS
Kevin AS - avatar
5 Réponses
+ 4
Some tracks in this thread: https://stackoverflow.com/questions/15528939/JUMP_LINK__&&__python__&&__JUMP_LINK-3-timed-input ... but maybe complete solution (previous ones don't interrupt the input) to be found among the answers of this one: https://stackoverflow.com/questions/492519/timeout-on-a-function-call [edit] And finally, this answer may help to do input inside a process (the track I would follow would be to do input inside process to be able to kill it after delay... but stdin is default closed for sub-process, and we need close the one of main process and reopeen it in the sub-process ^^ This mean also that we have to handle queue to communicate data between process, if I understand right ;P)... https://stackoverflow.com/questions/7489967/python-using-stdin-in-child-process/15766145#15766145
24th Jul 2017, 4:02 PM
visph
visph - avatar
+ 3
Yeah: that's not the most simple part of programming ^^ But that's an interesting part, anyway ;)
25th Jul 2017, 3:30 AM
visph
visph - avatar
0
damn.its so difficult to understand.almost a day to find out what is those code mean
25th Jul 2017, 3:10 AM
Kevin AS
Kevin AS - avatar
0
but thanx anyway
25th Jul 2017, 3:33 AM
Kevin AS
Kevin AS - avatar
0
true
3rd May 2023, 7:36 PM
Dharmendra Kumar
Dharmendra Kumar - avatar