title: Python thread executing function twice
body: <p>Atm I'm working on a game using tkinter. I'm working on algorithm that moves enemies through the game map.</p>
  
  <p>I will post only relevant lines, since the code is quiet hard-to-read.</p>
  
  <p>I'm using class Timer imported from threading.
  2 relevant functions are:</p>
  
  <pre><code>def add_enemies(self):
    enemy = self.enemies.pop(0)
    if enemy in '.':
       Timer(1, self.add_enemies).start()
    else:
       self.move_enemy(enemy,set())
       if not self.game_ended and self.enemies:
          Timer(1, self.add_enemies).start()
  
  def move_enemy(self, enemy, visited):
    if type(enemy) == str:
       if enemy in 'm':
          enemy = Mongol(self.canvas, *self.start)
    visited.add((enemy.x,enemy.y))
    for move in (-1,0),(0,1),(1,0),(0,-1):
        pos = (enemy.x + move[0], enemy.y+move[1])
        if pos in self.way and pos not in visited:
            print(pos)
            enemy.move(*move)
            enemy.take_shot(6)
            visited.add(pos)
            Timer(0.5, lambda: self.move_enemy(enemy, visited)).start()
  </code></pre>
  
  <p>This function should move the enemy, wait 0.5 second, then create a thread in which it recursively calls itself and moves the enemy again.</p>
  
  <p>It might not be the best solution the create another thread inside the thread, but all other solutions made my GUI to freeze while executing the function.</p>
  
  <p>Problem is, that Timer executes function move_enemy twice. Nothing else in the code can cause this problem.</p>
  
  <p>Simple print test of enemy position shows this:</p>
  
  <p><img src="https://s14.postimg.org/69lty5fk1/error.png" /></p>
  
  <p>It simply moves the enemy twice, and increases its position twice as shown on the picture.</p>