Python timer capability? 
Author Message
 Python timer capability?

I'm looking for a way to create a timer that will poll at a specified
time interval and do a callback if necessary.  We are presently doing
this with Tcl using Tcl_CreateTimerHandler, etc., and would like to do
the same thing either with Python, or in cooperation with Python.
If this can't be done, is there at least a way to access a top level
loop in the interpreter where it would check for signals, and then
create a timer function as above using that loop as an entry point?  
Any ideas or approaches on the subject would be greatly appreciated.
Thanks.

Aaron Kline



Sun, 12 Mar 2000 03:00:00 GMT  
 Python timer capability?

Quote:

> I'm looking for a way to create a timer that will poll at a specified
> time interval and do a callback if necessary.  We are presently doing
> this with Tcl using Tcl_CreateTimerHandler, etc., and would like to do
> the same thing either with Python, or in cooperation with Python.
> If this can't be done, is there at least a way to access a top level
> loop in the interpreter where it would check for signals, and then
> create a timer function as above using that loop as an entry point?
> Any ideas or approaches on the subject would be greatly appreciated.
> Thanks.

> Aaron Kline


There is the built in module signal, which should do what you want.

Certainly the interpreter restricts to not very time-critical
(some milliseconds) signal interrupts. They have to be handled inside
an external C-module.

--
Cheers,

Dirk



Sun, 12 Mar 2000 03:00:00 GMT  
 Python timer capability?

Quote:

> I'm looking for a way to create a timer that will poll at a specified
> time interval and do a callback if necessary.  We are presently doing
> this with Tcl using Tcl_CreateTimerHandler, etc., and would like to do
> the same thing either with Python, or in cooperation with Python.
> ...

I don't know on what platform you are running, but wxPython does
provide a portable timer across Win32/Unix.

Unfortunately, building the unix version can be a pain.

Harri

--

"Who is General Failure and why is he reading my hard disk ?"



Sun, 12 Mar 2000 03:00:00 GMT  
 Python timer capability?

Quote:
>I'm looking for a way to create a timer that will poll at a specified
>time interval and do a callback if necessary.  We are presently doing
>this with Tcl using Tcl_CreateTimerHandler, etc., and would like to do
>the same thing either with Python, or in cooperation with Python.
>If this can't be done, is there at least a way to access a top level
>loop in the interpreter where it would check for signals, and then
>create a timer function as above using that loop as an entry point?  
>Any ideas or approaches on the subject would be greatly appreciated.

Maybe you can use Tim O'Malley's EventLoop module:

ftp://ftp.bbn.com/pub/timo/python/eventloop.py

Cheers /F



Sun, 12 Mar 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Python with the VBA recording capabilities

2. Editors with Python or Active Scripting capability?

3. Capabilities of python?

4. Metalinguistic capability of Python?

5. Tcl vs Python in graphics capabilities

6. Python FTP-Class w/ Resuming-Capabilities -- General Questions

7. Tcl vs Python in graphics capabilities

8. Wait ms Timer Multiple returning inaccurate timer value

9. Using timer 2 instead of timer 1

10. Timers in Python?

11. Python timer

12. pty/select/timers/SIGINT ?s w/ embedded python in vim

 

 
Powered by phpBB® Forum Software