The main thread will exit when it finishes executing all the code in a script that does not run in a separate thread.
t.start() , , , script, .
, , .
, , , join . join , join, , .
for i in range(5):
threads[i].join()
print "main Exit"
@codesparkle, Pythonic , .
for thread in threads:
thread.join()
print "main Exit"