title: RuntimeError: threads can only be started once
body: <p>I was making a simple Python game. I was trying to fix the following error:</p>
  
  <blockquote>
    <p>RuntimeError: threads can only be started once</p>
  </blockquote>
  
  <p>I have tried <code>.cancel()</code> the timer but that hasn't seem to be working, and I have made a <code>if</code> statement to see if the timer <code>.is_alive</code> before executing it. The console is throwing the error off at <code>ball_char = play_timer.start()</code>.</p>
  
  <pre><code>def playball(state):
   batbox = [["@", "@", "@", "@"], ["@", "#", "#", "#", "@"], ["@", "#", "#", "#", "@"], ["@", "#", "#", "#", "@"], ["@", "@", "@", "@"]]
   play = "playing"
   play_timer = Timer(1.0, pitch(batbox))
   end_timer = Timer(6.0, pitch_end(play))
   play_timer.cancel()
   end_timer.cancel()
   pstate = "idle"
   inning = 1
   outs = 0
   pscore =0
   cscore = 0
   strikes = 0
   ball_row = 0
   ball_col = 0
   ball_char = "."
   while play == "playing":
       batbox = [["@", "@", "@", "@"], ["@", "#", "#", "#", "@"], ["@", "#", "#", "#", "@"], ["@", "#", "#", "#", "@"], ["@", "@", "@", "@"]]
       os.system('cls')  # on windows
       os.system('clear') # on linux / os x
       # Playing the game
       print "Press enter to start / hit the pitch"
       print_grid(batbox)
       input = raw_input("")
       pstate = "hitting"
       # Hitting
       if pstate == "hitting":
           ball_row = random_row(batbox) 
           ball_col = random_col(batbox)
           end_timer.start()
           while pstate == "hitting":
               batbox[ball_row][ball_col] = ball_char
               if play_timer.is_alive():
                   play_timer.cancel()
               else:
                   ball_char = play_timer.start()
   else:
       play_timer.cancel()
       end_timer.cancel()
       state = "mainmenue"
       return state
  </code></pre>