0

I need a way to continue past an input statement after a certain amount of time. As I see it, the code stops flowing completely when there is an input statement including other threads, which I have tried already:

import _thread
import time

def print_time(threadName, delay):
   count = 0
   while True:
      time.sleep(delay)
      count += 1
      if count >= 10:
         _thread.interrupt_main()

_thread.start_new_thread(print_time,("Thread-1", 0.5))

while 1:
   try:
      input(">")
   except:
      print("bye")
      input(">")

If anyone as an idea of how to stop the input statement, I am open, even if it's just a guess and it might not work.

claytonme
  • 37
  • 4

0 Answers0