我在无声安装某些程序时遇到了不愉快的情况。我不确定他们是否对带有值的安装标志使用了任何约定,但以下是安装应使用的内容:
"path with spaces\setup.exe" -uninst -s -f2"path with spaces\uninstall.log"
不能使用--f2=“path with spaces\uninstall.log”或-f2=“path with spaces\uninstall.log”或-f2“path with spaces\uninstall.log”
因此,如果我在Python中使用以下内容:
command = [self.setup_exe, '-uninst', '-s', fr'-f2"{uninstall_log_file}"']
子流程正在执行的命令(从子流程获取。list2cmdline(命令))是:
setup.exe" -uninst -s -f2\"some path\temp build 12\uninstall.log\"
基本上会出现斜杠,安装失败。 理论上,我可以创建自己的字符串,但另一个可执行文件的同一个提供程序提供了另一种与子进程更兼容的语法。我想知道是否有可能设置一个参数列表来满足安装程序的要求
如果你跑
从命令行,对
subprocess.call
的等效调用是相关问题 更多 >
编程相关推荐