【发布时间】:2019-04-08 23:23:32
【问题描述】:
我能够使用 subprocess 模块打开命令提示符并将目录更改为所需位置,但我无法传递更多参数来运行应用程序以及一些命令行参数。我是 subprocess 模块的新手,所以我对 stackoverflow 进行了一些搜索,但找不到所需的结果。
我的代码:
import subprocess
path = r"C:/Users/Application_Folder"
p = subprocess.Popen(r"cmd.exe", cwd="C:/Project_Files", shell=True)
期望的输出:
Path: C:\Users\Application_folder\Application.exe
Need to open the cmd prompt in windows at the Application_folder location,
run the Application.exe by passing some command line arguments, using python
【问题讨论】:
标签: python command-line-arguments command-prompt