subprocess.Popen accepts this string and starts the tcl shell process:
'"C:\\Program Files (x86)\\TCL\\bin\\tclsh.exe "'
If you can just see, I have encapsulated the string in double quotes. Now, when I try to give an argument to the tcl shell (which is essential because I am running tcl scripts), I get a surprising problem. For instance, When I pass this string to Popen:
""C:\\Program\\ Files\\ (x86)\\Tcl\\bin\\tclsh.exe " "C:/Users//Has Space//TestingTCLComms.tcl""
I get the following error:
"'C:\\Program\\' is not recognized as an internal or external command,
operable program or batch file.\r\n"
The Following executes properly on the command line:
"C:\Program Files (x86)\Tcl\bin\tclsh.exe " "C:/Users/Has Space/TestingTCLComms.tcl"
r"C:\Program Files (x86)\TCL\bin\tclsh.exe"
with this prefixr
to indicate that this is a literal string – Saullo Castro Oct 31 '13 at 13:35shell=True
in thePopen
call, like:Popen(your_string, shell=True)
, but without breaking the string... just write as if you were in the shell prompt, with all the arguments ans so on... – Saullo Castro Oct 31 '13 at 13:50