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

Win 环境,如何非阻塞运行一个 windows 命令?

  •  
  •   pppguest3962 · Aug 16, 2022 · 3171 views
    This topic created in 1549 days ago, the information mentioned may be changed or developed.

    os.system('notepad ' + errsavelogfile) #阻塞
    非阻塞,有何方法?

    5 replies  •  2022-08-16 18:30:40 +08:00
    frostming
    frostming
    Aug 16, 2022
    1
    subprocess.Popen(['notepad', errsavelogfile])
    cxxnullptr
    cxxnullptr
    Aug 16, 2022
    2
    放子进程里运行
    zjj19950716
    zjj19950716
    Aug 16, 2022
    3
    cmd /C start xxxxx
    sazima
    sazima
    Aug 16, 2022
    4
    loop.run_in_executor
    wwqgtxx
    wwqgtxx
    Aug 16, 2022
    5
    官方文档都说了多久了别再用 os.system 了,用 subprocess 模块
    https://docs.python.org/3/library/subprocess.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2688 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 04:20 · PVG 12:20 · LAX 20:20 · JFK 23:20
    ♥ Do have faith in what you're doing.