os.startfile() doesn't work

Asked by Bharatendu SOUMIL on 2019-05-22

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,

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
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

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

RaiMan (raimund-hocke) said : #3

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

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

Worked fine for other apps like Chrome, Firefox

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.