Python论坛  - 讨论区

标题:[python-chinese] python怎么实现定时器

2008年01月01日 星期二 11:56

FireBird ygonic在gmail.com
星期二 一月 1 11:56:00 HKT 2008

ÎÒÒ²ÕýÔÚѰÕÒÖУ¬Ð»Ð»ÁË¡£

ÔÚ07-12-28£¬lai yonghao <lanphaday在gmail.com> дµÀ£º
>
> Äã¿ÉÒÔÊÔÊÔ sched Ä£¿é
>
> >>> import sched, time
> >>> s=sched.scheduler(time.time, time.sleep)
> >>> def print_time(): print "From print_time", time.time()
> ...
> >>> def print_some_times():
> ...     print time.time()
> ...     s.enter(5, 1, print_time, ())
> ...     s.enter(10, 1, print_time, ())
> ...     s.run()
> ...     print time.time()
> ...
> >>> print_some_times()
> 930343690.257
> From print_time 930343695.274
> From print_time 930343700.273
> 930343700.276
>
>
>
> ÔÚ07-12-28£¬python python <python在tairan.net> дµÀ£º
> >
> > hi,
> >
> >     In the time module, use the time.sleep(seconds) function À´ÊµÏÖ¶¨Ê±Æ÷µÄ¹¦ÄÜ
> >
> > ------------------------------
> > Express yourself instantly with MSN Messenger! MSN Messenger<http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> >
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080101/703cfd85/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号