subprocess.Popen接受此字符串并启动tcl shell进程:
'"C:\\Program Files (x86)\\TCL\\bin\\tclsh.exe "'
如果你能看到,我用双引号封装了字符串。现在,当我尝试为tcl shell提供一个参数时(这是必不可少的,因为我正在运行tcl脚本),我遇到了一个令人惊讶的问题。例如,当我将此字符串传递给Popen时:
""C:\\Program\\ Files\\ (x86)\\Tcl\\bin\\tclsh.exe " "C:/Users//Has Space//TestingTCLComms.tcl""
我收到以下错误:
"'C:\\Program\\' is not recognized as an internal or external command,
operable program or batch file.\r\n"
以下命令行正确执行:
"C:\Program Files (x86)\Tcl\bin\tclsh.exe " "C:/Users/Has Space/TestingTCLComms.tcl"