|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
I've always created the object as needed - never tried to re-enter before.
One way to interpret the docs is that the start method can only be called once. If you allow run() to exit then the thread is finished. If isAlive() returns false then the thread has finished. Running even a simple test proved this is true: Code:
mport threading
import time
class test(threading.Thread):
def run(self):
print "Running"
a = test()
a.start()
time.sleep(2)
a.start()
So the class is not restartable. A browse through the module code might reveal why. Grim |
|
#17
|
||||
|
||||
|
legendary, thanks for that grim.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > running programs from python |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|