/ key = val的subprocess.call不起作用

时间:2019-07-01 16:19:27

标签: python windows subprocess

我正在尝试在Windows上执行以下命令。 (命令在CMD中起作用) "D:\xxxx\tool.exe" /RunScript="C:\xxxx\scdm.py" /Headless=True /Splash=False /Welcome=False /ExitAfterScript=True /ScriptArgs="C:\xxx\file.sat"

PS路径缩短了,如果需要,我可以提供完整路径

我正在使用subprocess.call,但似乎参数已被忽略

command = [scdm_dir, r'/RunScript="{}"'.format(scdm_script_path),
           r"/Headless=True", r"/Splash=False", r"/Welcome=False", r"/ExitAfterScript=True",
                  r'/ScriptArgs="{}"'.format(os.path.join(os.getcwd(), "Fluent", "fluent.sat"))]

  print(command)
  subprocess.call(command)```

output of print is:
>>> ['D:\xxxx\tool.exe', '/RunScript="C:\xxxx\scdm.py"', '/Headless=True', '/Splash=False', '/Welcome=False', '/ExitAfterScript=True', '/ScriptArgs="C:\xxx\file.sat"']

0 个答案:

没有答案