os.startfile() doesn't work

Asked by Bharatendu SOUMIL

Sometimes App.open () doesn't work. As a workaround i like using the python command:
os.startfile('Link to .exe')....but for some reason it throws the following error:

[error] Error caused by: Traceback (most recent call last): File "D:\Academic_Software\SikuliX\adminRights.sikuli\adminRights.py", line 20, in <module> os.startfile("C:\\Program Files\\4tiitoo\\NUIA\\Runtime\\bin\\NUIATrayMenu.exe") AttributeError: 'module' object has no attribute 'startfile' .

 ( I also did import os in the first line)

Any leads on this would be really appreciated

Kind regards,
Soumil

Question information

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

os.startfile is not available in Python language level 2.7 (only in 3+)

SikuliX uses Jython with Python language level 2.7

Revision history for this message
Bharatendu SOUMIL (soumil-bharatendu) said :
#2

Cool. thanks for the prompt respone. Also, is there a reason for App.open not working for certain apps, because for the above mentioned app it opens if i write a normal .py file and run it with the startfile() command

Revision history for this message
RaiMan (raimund-hocke) said :
#3

How exactly are you using App.open() for the above mentioned .exe?
What version of SikuliX?

Revision history for this message
Bharatendu SOUMIL (soumil-bharatendu) said :
#4

App.open("C:\\Program Files\\4tiitoo\\NUIA\\Runtime\\bin\\NUIATrayMenu.exe")
SikuliX 1.1.4
It doesnt report any error in the console log but doesn't do anything either

Revision history for this message
Bharatendu SOUMIL (soumil-bharatendu) said :
#5

Worked fine for other apps like Chrome, Firefox

Revision history for this message
TestMechanic (ndinev) said :
#6

try to type this into your console

C:\\Program Files\\4tiitoo\\NUIA\\Runtime\\bin\\NUIATrayMenu.exe

and see if program starts and releases the console

Can you help with this problem?

Provide an answer of your own, or ask Bharatendu SOUMIL for more information if necessary.

To post a message you must log in.