推荐学习书目
› 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 · 2263 views
    This topic created in 2976 days ago, the information mentioned may be changed or developed.
    windows 环境,想让 python 退出之后批处理继续执行,应该怎么操作,跪求指点。
    myyou
    myyou
    Sep 26, 2018❤️1
    1
    用 subprocess.Popen 应该可以

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

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

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