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

monkeys paw monkey at joemoney.net
Thu Jul 14 19:00:07 CEST 2011


On 7/9/2011 10:01 PM, John Salerno wrote:
> Thanks everyone! I probably should have said something like "Python,
> if possible and efficient, otherwise any other method" ! :)
>
> I'll look into the Task Scheduler. Thanks again!

You could use the below code. time.sleep(# seconds in a day)
where i == 30 would run once a day for a month

import time
i=0
while (1):
	print 'hello'
	time.sleep(2)   # Change this to number of seconds in a day
	if (i == 3):    # make this 30 for a month
		break
	i = i + 1





More information about the Python-list mailing list