Re: How to make Python poll a PYTHON METHOD

2007-05-10 Thread Grant Edwards
On 2007-05-10, johnny <[EMAIL PROTECTED]> wrote: > Is it possible to call threads inside another thread (nested threads)? No. It's not possible to call threads because they're not callable objects. (I'm assuming you're talking about Thread objects from the threading module.) If you're asking if

Re: How to make Python poll a PYTHON METHOD

2007-05-10 Thread johnny
Is it possible to call threads inside another thread (nested threads)? The example above creates a thread to call a function "eat" every time based on a specified interval. Now for example, if I make the called function "eat" to spawn threads to do the work in a queue and when all jobs are done, s

Re: How to make Python poll a PYTHON METHOD

2007-05-07 Thread Nick Vatamaniuc
On May 7, 10:42 pm, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote: > On May 7, 10:07 pm, johnny <[EMAIL PROTECTED]> wrote: > > > Is there a way to call a function on a specified interval(seconds, > > milliseconds) every time, like polling user defined method? > > > Thanks. > > Sure, > > >>> def baz():

Re: How to make Python poll a PYTHON METHOD

2007-05-07 Thread James Stroud
johnny wrote: > Is there a way to call a function on a specified interval(seconds, > milliseconds) every time, like polling user defined method? > > Thanks. > A very literal interpretation of your question yields the following very simple answer: import time while True: time.sleep(some

Re: How to make Python poll a PYTHON METHOD

2007-05-07 Thread Nick Vatamaniuc
On May 7, 10:07 pm, johnny <[EMAIL PROTECTED]> wrote: > Is there a way to call a function on a specified interval(seconds, > milliseconds) every time, like polling user defined method? > > Thanks. Sure, >>> def baz(): ...: print "Baz!" ...: >>> from threading import Timer >>> timer=Ti

How to make Python poll a PYTHON METHOD

2007-05-07 Thread johnny
Is there a way to call a function on a specified interval(seconds, milliseconds) every time, like polling user defined method? Thanks. -- http://mail.python.org/mailman/listinfo/python-list