почему этот скрипт python ожидает выполнения потока таймера?

from threading import Timer

def startTimer():

  t = Timer(10.0, foo, ['hello world', 'tell me more'] )
  t.start()
  print 'Timer function invoked'
  print 'function exit'

def foo(msg, msg2):
  print 'foo was executed'
  print msg
  print msg2

if __name__ == '__main__':  
  startTimer()
  print 'end of program'

Я сохранил приведенный выше код в файле (timer.py), а затем набрал python timer.py в оболочке. Но он ждал, пока foo () не будет выполнен. Почему это так? Как вы называете это поведение / стиль выполнения?

7
задан deostroll 25 December 2010 в 18:16
поделиться