How can I make a program automatically run once per day?

Andrew Berg bahamutzero8825 at gmail.com
Sat Jul 9 20:49:14 EDT 2011


On 2011.07.09 07:26 PM, John Salerno wrote:
> I have a script that does some stuff that I want to run every day for
> maybe a week, or a month. So far I've been good about running it every
> night, but is there some way (using Python, of course) that I can make
> it automatically run at a set time each night?
I would use the OS to worry about scheduling (cron/Windows Task
Scheduler/whatever), but in Python, you could probably use a while True
loop, time.sleep() (to specify how often to check the time) and a
datetime.time or datetime.now object (e.g. datetime.now().hour).



More information about the Python-list mailing list