Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45584

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:script': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'random': 0.14; '"run': 0.16; 'enjoy,': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'script,': 0.16; 'simpson': 0.16; 'subject:run': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'script.': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'run': 0.32; 'possible.': 0.35; 'but': 0.35; 'there': 0.35; 'received:com.au': 0.36; 'charset:us-ascii': 0.36; "i'll": 0.36; 'subject:?': 0.36; 'so,': 0.37; 'two': 0.37; 'received:211': 0.38; 'how': 0.40; 'first': 0.61; 'you.': 0.62; 'content- disposition:inline': 0.62; 'pick': 0.64; 'to:addr:gmail.com': 0.65; 'subject:day': 0.69; 'day': 0.76; 'ban': 0.91; 'roads': 0.91
Date Mon, 20 May 2013 14:12:05 +1000
From Cameron Simpson <cs@zip.com.au>
To Avnesh Shakya <avnesh.nitk@gmail.com>
Subject Re: How to run a python script twice randomly in a day?
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <8a44bb69-5e8c-4725-a0c8-505b3ecc1d89@googlegroups.com>
User-Agent Mutt/1.5.21 (2010-09-15)
References <8a44bb69-5e8c-4725-a0c8-505b3ecc1d89@googlegroups.com>
X-Optus-CM-Score 0
X-Optus-CM-Analysis v=2.0 cv=e/de0tV/ c=1 sm=1 a=wom5GMh1gUkA:10 a=nhmRsZCgQ00A:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=ZtCCktOnAAAA:8 a=at-lseB3AMEA:10 a=pGLkceISAAAA:8 a=xkXVbSM33_tpg9KdX7YA:9 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=ChdAjXE5lkUvdteQbhpnkQ==:117
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1857.1369024163.3114.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369024163 news.xs4all.nl 15964 [2001:888:2000:d::a6]:46655
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:45584

Show key headers only | View raw


On 19May2013 20:54, Avnesh Shakya <avnesh.nitk@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@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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

How to run a python script twice randomly in a day? Avnesh Shakya <avnesh.nitk@gmail.com> - 2013-05-19 20:54 -0700
  Re: How to run a python script twice randomly in a day? Jason Friedman <jsf80238@gmail.com> - 2013-05-19 22:27 -0600
  Re: How to run a python script twice randomly in a day? Cameron Simpson <cs@zip.com.au> - 2013-05-20 14:12 +1000

csiph-web