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

用 Python 调用批处理,如何让 Python 退出之后批处理继续运行?

  •  
  •   d0m2o08 · Sep 26, 2018 · 2205 views
    This topic created in 2936 days ago, the information mentioned may be changed or developed.
    windows 环境,想让 python 退出之后批处理继续执行,应该怎么操作,跪求指点。
    myyou
        1
    myyou  
       Sep 26, 2018   ❤️ 1
    用 subprocess.Popen 应该可以

    ```
    import subprocess
    subprocess.Popen(cmd, shell=True)
    ```
    Qzier
        2
    Qzier  
       Sep 27, 2018 via iPhone
    不清楚,我每次运行 ffmpeg 时,python 退出,还在运行
    ltoddy
        3
    ltoddy  
       Sep 27, 2018
    ```
    import signal

    signal.signal(signal.SIGINT, handler)
    ```

    我不知道 Windows 支不支持信号, 那个 handler 是一个函数,函数里面写上 Python 退出之后你想执行的代码.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3128 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 10:51 · PVG 18:51 · LAX 03:51 · JFK 06:51
    ♥ Do have faith in what you're doing.