Unable to run .exe file with environment variable
Hi RaiMan,
I wrote a new version of my previous bug. This time I don't use the os.environ but subprocess.call.
Thanks! I very much appreciate your helpfulness in this forum.
I don't want to hard code the path to the .exe file I want to test in my .sikuli file. Our scheduler will run the .exe file through the settings of environment variables, without hard coding.
And we don't want to change the path setting, but only run through an environment variable.
I wrote the following script, it works on python but not on sikuli. Would you have any alternatives\
#MyApp environment variable is created in system in variables under System\Advanced Settings
# My file path is: C:\2014-
#We can run the following script on Python, it's OK
#We can also run "%MyApp%" on command prompt, it's OK.
from sikuli import*
import os, sys
import subprocess
os.system('echo %MyApp%') #We have the path to environment variable. [GOOD]
subprocess.
We have the following error message (not pasted the whole message):
'C:\2014-03-07' is not recognized as an internal or external command,
operable program or batch file.
Exception in thread "AWT-EventQueue-0" java.lang.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at javax.swing.
at
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply:
This question was originally filed as bug #1304366.