Python subprocess.Popen([";open";,";target.mkv";],shell=True)无法打开指定的文件

Python subprocess.Popen([";open";,";target.mkv";],shell=True)无法打开指定的文件,python,subprocess,popen,Python,Subprocess,Popen,我正在学习子流程打开多媒体.mkv文件 首先,我测试: In [25]: subprocess.Popen( ...: ["open", "/Volumes/Transcend/Downloads/The.Adventure.of.English.Ep4.mkv"], shell=True) ...: Out[25]: <subprocess.Popen at 0x10b063908> In [26]: Usage: open [-e] [-t] [

我正在学习
子流程
打开多媒体.mkv文件

首先,我测试:

In [25]: subprocess.Popen(
    ...:     ["open", "/Volumes/Transcend/Downloads/The.Adventure.of.English.Ep4.mkv"], shell=True)
    ...:     
Out[25]: <subprocess.Popen at 0x10b063908>
In [26]: Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-s <partial SDK name>][-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
[25]中的
:subprocess.Popen(
…:[“open”,“/Volumes/extend/Downloads/The.advention.of.English.Ep4.mkv”],shell=True)
...:     
出[25]:
在[26]中:用法:打开[-e][t][f][W][R][n][g][h][s][b][a][filename][--args参数]
所发生的只是提示使用消息

然后,我试着:

In [27]: subprocess.Popen('open "/Volumes/Transcend/Downloads/The.Adventure.of.English.Ep4.mkv"', shell=True)
Out[27]: <subprocess.Popen at 0x10b114208>
[27]中的
:subprocess.Popen('open”/Volumes/extend/Downloads/The.advention.of.English.Ep4.mkv',shell=True)
出[27]:
它工作了,并立即打开了目标文件

我注意到
[]
的第一个选项比后一个“字符串”选项更可取


[]
选项无法打开文件有什么问题?

来自
子流程.Popen
构造函数():

shell参数(默认为False)指定是否将shell用作要执行的程序。如果shell为True,建议将args作为字符串而不是序列传递


在第一个选项中不需要
shell=True