V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
triThirty
V2EX  ›  Python

新手, python 程序求思路。

  •  
  •   triThirty · 2015-10-24 16:28:08 +08:00 · 3308 次点击
    这是一个创建于 3078 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近想写个程序,大致是这样的,设置一周或者一个月的每天指定时间点(例如,指定未来一个月每天的晚上 6 点),当时间到达指定时间点时,电脑弹出特定信息。我现在的想法是轮询时间,如果到达时间点则执行程序。但是如果采用回调方法,当电脑系统时间到达指定时间点,回调执行方法,这种思路不知道行的通不?? ps :电脑系统时 osx 10.8
    6 条回复    2015-10-25 12:41:14 +08:00
    geeklian
        1
    geeklian  
       2015-10-24 16:32:32 +08:00
    不要重复造轮子...

    直接 crontab 或者 import schedule 不挺好么..
    triThirty
        2
    triThirty  
    OP
       2015-10-24 16:42:21 +08:00
    @geeklian 所噶~~~~~对库还是了解的不熟啊。
    wizardforcel
        3
    wizardforcel  
       2015-10-24 17:59:29 +08:00 via Android
    做成 daemon ?还是托管给 crontab 吧。
    hcymk2
        4
    hcymk2  
       2015-10-24 18:11:19 +08:00
    crontab
    ericls
        5
    ericls  
       2015-10-24 23:42:46 +08:00
    celery heartbeat
    mengzhuo
        6
    mengzhuo  
       2015-10-25 12:41:14 +08:00 via iPhone
    也可以用 sleep
    但不用 daemon
    不过他们说的 crontab 才是正道
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5430 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 08:42 · PVG 16:42 · LAX 01:42 · JFK 04:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.