Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!novso.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.068 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'python,': 0.02; 'solution,': 0.09; 'subject:script': 0.09; 'python': 0.11; 'delay,': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'things.': 0.19; 'reset': 0.22; 'creating': 0.23; 'script': 0.25; 'gets': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; '(although': 0.31; 'clock': 0.31; 'doc': 0.31; 'fine,': 0.31; 'running': 0.33; 'entirely': 0.33; 'maybe': 0.34; 'problem': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'module.': 0.36; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'skip:& 20': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'solve': 0.60; 'john': 0.61; 'first': 0.61; 'complete': 0.62; 'kind': 0.63; 'within': 0.65; 'subject:there': 0.68; 'counts': 0.83; 'delay.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to :content-type; bh=oMM9oLSVv/1QQaZFu1O+Ol6nSXRyvT6fdi+i4BsRedY=; b=Y3IhXBFaSrWX+Itze9BD4gyXU9oyKjfkhkCAUgj8+6+tI2Jk41/yJAiQk7fLHG7z4J x4pdJgtqRmnhvbo3OrxDTdevwh2hOFM8mrMkqd8yLEA9ym84h7yosFTWVf/nFiABKj56 GwY+KTYGASR9nV6Rm/iQ2ZIIwgJ41/9FzNwtBE4gVoHzJdAaVuTtN4kbp3dZfqfcUZYo 9DATmsSA5lcuTCISo3PQbchAe/h5sxE6Abztfo/rwd3U4W0LjCxQppP9QeRuX3xY2Yek WGO1/6ib2PHMhf1oS7hMxa5W9ZA66ByhPL9vBTPXtljdn0jSXcOcFXXZi5QwLBO/7S4x 9HhQ== X-Received: by 10.50.114.35 with SMTP id jd3mr10294219igb.31.1418848928759; Wed, 17 Dec 2014 12:42:08 -0800 (PST) MIME-Version: 1.0 References: From: Juan Christian Date: Wed, 17 Dec 2014 20:42:08 +0000 Subject: Re: Is there a way to schedule my script? To: python-list@python.org Content-Type: multipart/alternative; boundary=047d7b2e0a016388cd050a6f8238 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1418849283 news.xs4all.nl 2971 [2001:888:2000:d::a6]:47295 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:82614 --047d7b2e0a016388cd050a6f8238 Content-Type: text/plain; charset=UTF-8 On Wed Dec 17 2014 at 6:25:39 PM John Gordon wrote: If you want to solve your problem entirely within Python, look at the "scheduler" module. (Although even this isn't a complete solution, as you still have to make sure the program is running in the first place...) My script is running fine, Win/OSX/Linux and I don't want to ruin that using system specific things. I looked at sched doc and it's only for creating a delay, maybe a good approach would be to call the sched and check if time = 11:59PM, then set delay to 1h and when the time goes 9AM, it returns to my normal delay. Is there any kind of time calculation in Python that counts the time like 0, 1, 2, 3... so that 0AM would be 0, and 11:59PM would be let's say '645633332'? And everyday it gets a reset when the clock 'turns'? --047d7b2e0a016388cd050a6f8238 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed Dec 17 2014 at 6:25:39 PM John Gordon <= ;gordon@panix.com> wrote:
If= you want to solve your problem entirely within Python, look at the
&qu= ot;scheduler" module. (Although even this isn't a complete soluti= on, as you
still have to make sure the program is running in the first = place...)


My script is running fine, Win/= OSX/Linux and I don't want to ruin that using system specific things.

I looked at sched doc and it's only for creatin= g a delay, maybe a good approach would be to call the sched and check if ti= me =3D 11:59PM, then set delay to 1h and when the time goes 9AM, it returns= to my normal delay.

Is there any kind of time cal= culation in Python that counts the time like 0, 1, 2, 3... so that 0AM woul= d be 0, and 11:59PM would be let's say '645633332'? And everyda= y it gets a reset when the clock 'turns'?
--047d7b2e0a016388cd050a6f8238--