[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: is it a bug?

Gabriel Genellina

1/27/2008 8:38:00 PM

En Sun, 27 Jan 2008 14:21:20 -0200, Mr Shore <shore.cloud@gmail.com>
escribi�:

> import threading
> import time
> class timer(threading.Thread):
> def __init__(self,no,interval):
> threading.Thread.__init__(self)
> self.no=no
> self.interval=interval
>
> def run(self):
> while True:
> print 'Thread Object (%d), Time:%s'%(self.no,time.ctime())
> time.sleep(self.interval)
>
> def test():
> threadone=timer(1,1)
> threadtwo=timer(2,3)
> threadone.start()
> threadtwo.start()
> print 'main thread'
>
> if __name__=='__main__':
> test()
> when I run the above programme,an error comes out but ignored
> Exception exceptions.AttributeError: '_shutdown' in <module 'threading'
> from
> 'F:
> \Python25\lib\threading.pyc'> ignored

That looks like an error when Python is shutting down itself. As your
program never ends, how did you stop it?

--
Gabriel Genellina