推荐学习书目
› 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
gamexg
V2EX  ›  Python

python os.system(第三方程序),有时第三方程序崩溃, windows 弹出“XXX 已停止工作”对话框,但是 os.system 还被阻塞着, python 怎么知道程序已经崩溃了呢?

  •  
  •   gamexg · Apr 8, 2015 · 5894 views
    This topic created in 4189 days ago, the information mentioned may be changed or developed.
    4 replies  •  2015-04-08 23:26:08 +08:00
    9hills
        1
    9hills  
       Apr 8, 2015 via iPad
    不要用 os.system

    Python 3 用 sub process带 timeout

    Python2 用 sh
    gamexg
        2
    gamexg  
    OP
       Apr 8, 2015
    @9hills 超时机制不能用啊,第三方程序有时会满CPU工作数小时,靠超时判断的话太浪费资源了。
    9hills
        3
    9hills  
       Apr 8, 2015 via iPad
    @gamexg 那就保证第三方程序不阻塞而是退掉。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2698 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 06:31 · PVG 14:31 · LAX 23:31 · JFK 02:31
    ♥ Do have faith in what you're doing.