Jonathan Shan wrote:
Hello,
I am trying to call a function every 5 seconds. My understanding of
time.sleep() is during the sleep time everything "stops". However, in
my application, there are background processes that must be running
continuously during the five second interval. Thus, threading.
hmm.. why use while True? After 5 secs, the function is going to run. so
t = threading.Thread(5.0, func)
t.start()
should just work. Put it in a infinite loop will start the thread and
then start a the stopped thread... forever.
Jim
On Jul 6, 2007, at 2:40 PM, Jonathan Shan wrote:
> Hello,
On Fri, 06 Jul 2007 14:40:16 -0700, Jonathan Shan wrote:
> I am trying to call a function every 5 seconds. My understanding of
> time.sleep() is during the sleep time everything "stops".
Not "everything", just the thread in which `sleep()` is called.
> However, in my application, there are backg
Hello,
I am trying to call a function every 5 seconds. My understanding of
time.sleep() is during the sleep time everything "stops". However, in
my application, there are background processes that must be running
continuously during the five second interval. Thus, threading.Timer
seems like a good
Dennis Lee Bieber ha scritto:
> Ah, sorry... Warned you that I didn't test...
>
> Duplicate the block of lines with the .join() calls. Put this block
> just before them, but after the threading.Thread calls, and change the
> .join() to .start()
Tnx Dennis I resolved yesterday after th
Hi Dennis,
I have another little problem with your source:
Traceback (most recent call last):
File "main.py", line 86, in
kdi.join() # wait for kdi thread to exit NO CPU HOG BUSY LOOPS
File "d:\programmi\python25\lib\threading.py", line 549, in join
assert self.__started, "cannot joi
Tnx Dennis,
this is my first python program, so I don't know every modules :(
Anyway thank you so much for the suggestions, corrections and for the
whole program :)
Thank you
--
http://mail.python.org/mailman/listinfo/python-list
Hi guys,
when I close the application I get the following error:
-
Traceback (most recent call last):
File "main.py", line 88, in
while exit : pass
KeyboardInterrupt
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
--