Can't launch scripts from command line with help a command subproces.Popen()

Asked by Hurski paul

Hello,
I run scripts from one main script and in this case I use command subprocess.Popen().
In the path to 'Sikuli-ide.bat' and path to the folder which includes executable scripts consists spaces.

Example:
START = '"C:\Program Files (x86)\Sikuli X\Sikuli-IDE.bat" -r "C:\Documents and Settings\Administrator\GT_Autotest\Source_Scripts\1.sikuli"'
Popen(START, shell = True)

Result:
I get a message: "C:\Program" is not inside or outside command.
But when I run it ( "C:\Program Files (x86)\Sikuli X\Sikuli-IDE.bat" -r "C:\Documents and Settings\Administrator\GT_Autotest\Source_Scripts\1.sikuli") in command line it works well!

Can you help me to resolve with this problem?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Hurski paul
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

you might try the args-as-list version of Popen:

START = ["C:\Program Files (x86)\Sikuli X\Sikuli-IDE.bat", "-r", "C:\Documents and Settings\Administrator\GT_Autotest\Source_Scripts\1.sikuli"]
Popen(START, shell = True)

Revision history for this message
Hurski paul (hurski-p) said :
#2

Thanks, RaiMan!
It's didn't work too, but I've found information how to work 'Popen'. It works when parametr 'shell' is false for variable with args-as-list.