[Python]使用带参数的子进程打开程序 [英] [Python]open program using subprocess with arguments

查看:182
本文介绍了[Python]使用带参数的子进程打开程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!我正在使用python 2.7,我想通过我的python脚本打开子进程中的另一个可执行文件。我特意使用subprocess.Popen方法。现在,我想要的是在子进程中打开这个程序...但也传递参数给它。有办法吗?谢谢



我尝试了什么:



subprocess.Popen( ExecutablePath.exe -i myargument)

解决方案

17.1 。 subprocess - 子流程管理 - Python 2.7.13文档 [ ^ ]。

hey ! I am using python 2.7, and i want to open through my python script another executable in a subprocess. I am specifically using subprocess.Popen method. Now, what i want is to open this program in a subprocess... but also pass arguments to it. Is there a way ?? Thanks

What I have tried:

subprocess.Popen("ExecutablePath.exe -i myargument")

解决方案

17.1. subprocess — Subprocess management — Python 2.7.13 documentation[^].


这篇关于[Python]使用带参数的子进程打开程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆