Make a function call itself after set amount of time

Valentino Volonghi aka Dialtone dialtone#NOSPAM#.despammed at aruba.it
Fri Jan 16 18:18:26 EST 2004


Bart Nessux <bart_nessux at hotmail.com> writes:

> How do I make a function call itself every 24 hours. Also, is there a
> way to start the program automatically w/o depending on the OS
> functions like 'Task Scheduler' or 'Start Up Items'... this is on
> Windows 2k and xp. Below is an example of what I'm trying to do.
[snip]

Never seen twisted? Here is a little tip:

from twisted.internet import reactor
def doSomething(mystring):
    print mystring
    reactor.callLater(5, doSomething, mystring)
doSomething("ciao")
reactor.run()

Twisted also has a lot of already implemented protocols for almost
everything related to net so maybe you can think of a new version of
your app using twisted's protocols.

www.twistedmatrix.com

-- 
Valentino Volonghi, Regia SpA, Milan
Linux User #310274, Gentoo Proud User



More information about the Python-list mailing list