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


Groups > comp.lang.python > #8610

Re: how to call a function for evry 10 secs

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'instance,': 0.05; 'mrab': 0.05; 'python': 0.08; 'rounded': 0.09; 'switches': 0.09; 'exception': 0.12; 'am,': 0.13; 'received:209.85.214.174': 0.13; 'received:mail-iw0-f174.google.com': 0.13; 'wrote:': 0.15; '3.2.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ioerror': 0.16; 'sleeping': 0.16; 'subject:function': 0.16; "hasn't": 0.16; 'executing': 0.19; 'seconds': 0.21; 'header:In- Reply-To:1': 0.22; 'documented': 0.23; 'changed': 0.25; 'specified': 0.25; 'fri,': 0.28; 'received:209.85.214': 0.28; 'bit': 0.28; 'message-id:@mail.gmail.com': 0.28; 'sleep': 0.30; 'looks': 0.30; 'to:addr:python-list': 0.34; 'that,': 0.35; 'switch': 0.35; '(for': 0.36; 'minimum': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'back': 0.63; 'increase': 0.64; 'further': 0.65; 'resolution,': 0.84; 'stretch': 0.91; 'subject:call': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mc7BbOQqJ16wBNgnzO7djZ3h5vQl3zcelhVBIm6VrYU=; b=uazRw/RsoyBrP4ij/c5rfdKfmCEbkBspstRURo3KfZe7EmVpO3rv2JapWp8FFzAyt/ MBVw9j22FsU26CrS8IzkEntfxicbJxSeGw2xyWKQLHTRBUysBG1e7V0LeKQ1fTy6gQAh xSKu+MBeLylnRONHJ9fbQyObeXflXpIRVmLPU=
MIME-Version 1.0
In-Reply-To <4E0CAFD5.50404@mrabarnett.plus.com>
References <f63802d3-da39-4efb-a09a-89458a9c1f92@h38g2000pro.googlegroups.com> <mailman.518.1309410399.1164.python-list@python.org> <mvotd8-v5k.ln1@satorlaser.homedns.org> <iui922$6eq$1@dough.gmane.org> <4E0CAFD5.50404@mrabarnett.plus.com>
Date Fri, 1 Jul 2011 03:36:12 +1000
Subject Re: how to call a function for evry 10 secs
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.528.1309455375.1164.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1309455375 news.xs4all.nl 21846 [2001:888:2000:d::a6]:52254
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8610

Show key headers only | View raw


On Fri, Jul 1, 2011 at 3:18 AM, MRAB <python@mrabarnett.plus.com> wrote:
> Looks like it hasn't changed even in WinXP, Python 3.2.
>
> Is IOError what you'd expect, anyway?
>
> What should it do in Python 3.2? Exception or max(seconds, 0)?

The obvious thing for it to do is to go back in time and resume
executing that many seconds ago, but failing that, I would have it do
the latter. It's already documented as potentially sleeping a bit
longer than the specified time (for instance, it's rounded up to the
minimum resolution, and task switches can increase the time), so it's
not much of a stretch to have negative sleep times result in a
yield/context switch and no further sleeping.

ChrisA

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


Thread

how to call a function for evry 10 secs hisan <santosh.ssit@gmail.com> - 2011-06-29 10:39 -0700
  Re: how to call a function for evry 10 secs Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-30 03:42 +1000
  Re: how to call a function for evry 10 secs Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-06-29 22:06 -0700
    Re: how to call a function for evry 10 secs Laurent Claessens <moky.math@gmail.com> - 2011-06-30 09:05 +0200
    Re: how to call a function for evry 10 secs Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-06-30 10:37 +0200
      Re: how to call a function for evry 10 secs Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-06-30 09:42 -0700
        Re: how to call a function for evry 10 secs Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-06-30 21:04 +0200
          Re: how to call a function for evry 10 secs Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-06-30 23:29 -0700
          Re: how to call a function for evry 10 secs Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-07-01 08:50 +0200
      Re: how to call a function for evry 10 secs MRAB <python@mrabarnett.plus.com> - 2011-06-30 18:18 +0100
      Re: how to call a function for evry 10 secs Chris Angelico <rosuav@gmail.com> - 2011-07-01 03:36 +1000
      Re: how to call a function for evry 10 secs Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-30 11:42 -0600

csiph-web