V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
pyengwoei
V2EX  ›  Python

请问 Popen 模块的这一坨参数是什么意思

  •  
  •   pyengwoei · 2016-08-31 13:49:37 +08:00 · 1862 次点击
    这是一个创建于 2796 天前的主题,其中的信息可能已经有所发展或是发生改变。

    网上说的用法不是这样吗
    aaa = "G:/New.exe"
    Popen(aaa, shell=True)
    8 条回复    2016-09-01 11:04:52 +08:00
    julyclyde
        1
    julyclyde  
       2016-08-31 14:32:44 +08:00
    Popen 模块是什么?
    julyclyde
        2
    julyclyde  
       2016-08-31 14:33:07 +08:00
    提醒你注意一下那个方括号,再参悟一下函数调用的语法
    ericls
        3
    ericls  
       2016-08-31 14:38:55 +08:00
    那只是列表里面的元素而已
    zguangyu123
        4
    zguangyu123  
       2016-08-31 14:43:13 +08:00
    这些参数是传给 popen 调用的程序的参数。
    pyengwoei
        5
    pyengwoei  
    OP
       2016-08-31 15:39:00 +08:00
    @zguangyu123 Popen 的参数我看格式都不是这样的啦
    pyengwoei
        6
    pyengwoei  
    OP
       2016-08-31 15:39:32 +08:00
    @ericls 我知道是列表里面的元素,但是这个传进去有什么用啦
    julyclyde
        7
    julyclyde  
       2016-08-31 20:46:20 +08:00
    @pyengwoei 起什么作用要由被运行的那个程序来解释
    hasdream
        8
    hasdream  
       2016-09-01 11:04:52 +08:00
    subprocess.Popen 你标注那些是执行程序需要的参数
    这个函数执行带参数 就是 Popen(['ls', '-als'])
    这个函数一系列参数 bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3017 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:29 · PVG 16:29 · LAX 01:29 · JFK 04:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.