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

Python 调.exe 程序并传参

  •  
  •   xxer · Apr 16, 2015 · 6364 views
    This topic created in 4223 days ago, the information mentioned may be changed or developed.

    win环境下,python调.exe,并需要python向.exe传递几个参数(包括地址参数等),求教怎么处理。

    4 replies  •  2015-04-16 21:09:30 +08:00
    marchon
    marchon
    Apr 16, 2015
    2
    推荐用subprocess.Popen
    xxer
    xxer
    OP
    Apr 16, 2015 via Android
    3
    @marchon 请问传参该如何处理?能否举例一下啊?
    quadpixels
    quadpixels
    Apr 16, 2015
    4
    @xxer
    在Linux下是这样的(程序名和参数存在一个列表里);在Windows下应该也差不多吧
    ``pipe = subprocess.Popen(["ls", "-l", "."], shell=False, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)``
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   752 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:21 · PVG 07:21 · LAX 15:21 · JFK 18:21
    ♥ Do have faith in what you're doing.