← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #246693]: Unable to run .exe file with environment variable

 

Question #246693 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/246693

    Status: Open => Answered

RaiMan proposed the following answer:
With shell=True, on Windows the given command string is given to
CMD.EXE, which expects the string to be an executable command and be
quoted according to the rules of CMD.EXE.

If the executable filename contains special characters, that have a
meaning when parsing a command line - like your ( ... ) - then the
complete command has to be in double-double-quotes:

subprocess.call('""%MyApp%""', shell = True)

... but IMHO this should work also:

subprocess.call(os.environ["MYAPP"])

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.