How to run a python script twice randomly in a day?

Cameron Simpson cs at zip.com.au
Mon May 20 00:12:05 EDT 2013


On 19May2013 20:54, Avnesh Shakya <avnesh.nitk at gmail.com> wrote:
|    How to run a python script twice randomly in a day? Actually
| I want to run my script randomly in a day and twice only. Please
| help me.. how is it possible.

Do you mean "run twice a day, each at random times"?

If so, do the obvious: at midnight, pick two random times. Sleep
until the first time, run the script, sleep until the second time,
run the script.

There are various ways to do the sleeping and midnight bits; they're
up to you.

Enjoy,
-- 
Cameron Simpson <cs at zip.com.au>

The ZZR-1100 is not the bike for me, but the day they invent "nerf" roads
and ban radars I'll be the first in line......AMCN



More information about the Python-list mailing list