推荐学习书目
› 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 · 6228 views
    This topic created in 4180 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
    zhipeng
        1
    zhipeng  
       Apr 16, 2015
    marchon
        2
    marchon  
       Apr 16, 2015
    推荐用subprocess.Popen
    xxer
        3
    xxer  
    OP
       Apr 16, 2015 via Android
    @marchon 请问传参该如何处理?能否举例一下啊?
    quadpixels
        4
    quadpixels  
       Apr 16, 2015
    @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   ·   864 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:58 · PVG 03:58 · LAX 12:58 · JFK 15:58
    ♥ Do have faith in what you're doing.