For scheduling, I use eventlet package and spawn_after_local .
http://eventlet.net
But you must be aware of the constraints like using monkey patched modules .
Le Mon, 18 Oct 2010 21:21:41 -0700,
TomF tomf.sess...@gmail.com a écrit :
I'm writing a simple simulator, and I want to schedule
TomF wrote:
I'm writing a simple simulator, and I want to schedule an action to
occur at a later time. Basically, at some later point I want to call a
function f(a, b, c). But the values of a, b and c are determined at
the current time.
One way way to do this is to keep a list of entries
Thanks for the ideas, everyone.
functools.partial and lambda expressions seem like a more pythonic way
of doing what I want. I don't know whether they're actually more
efficient or better, but at least they eliminate the need to carry args
around separately.
I'd forgotten Python has a
For me nothing beats using twisted ( http://www.twistedmatrix.com ) with
its clean implementation of deferreds and a host of other useful things
for simulations besides being the 'Swiss Army Knife' of networking in
Python. If you throw in stackless ( http://www.stackless.com )
simulations with
I'm writing a simple simulator, and I want to schedule an action to
occur at a later time. Basically, at some later point I want to call a
function f(a, b, c). But the values of a, b and c are determined at
the current time.
One way way to do this is to keep a list of entries of the form
On Mon, Oct 18, 2010 at 9:21 PM, TomF tomf.sess...@gmail.com wrote:
I'm writing a simple simulator, and I want to schedule an action to occur at
a later time. Basically, at some later point I want to call a function f(a,
b, c). But the values of a, b and c are determined at the current time.
On Mon, 18 Oct 2010 21:21:41 -0700, TomF wrote:
I'm writing a simple simulator, and I want to schedule an action to
occur at a later time. Basically, at some later point I want to call a
function f(a, b, c). But the values of a, b and c are determined at the
current time.
One way way to
In message 2010101821214168010-tomfsess...@gmailcom, TomF wrote:
One way way to do this is to keep a list of entries of the form [[TIME,
FN, ARGS]...] and at simulated time TIME do:
fn(*args) or fn(**kwargs)
--
http://mail.python.org/mailman/listinfo/python-list
On 19Oct2010 04:59, Steven D'Aprano steve-remove-t...@cybersource.com.au
wrote:
| Chris Rebert has already mentioned the sched module. Otherwise, put the
| function call in a thread, and have the thread use time.sleep to wait
| until the right time to execute.
There is also the Timer class