← Back to team overview

sikuli-driver team mailing list archive

[Question #240852]: It seems that __file__ can't work in Sikuli

 

New question #240852 on Sikuli:
https://answers.launchpad.net/sikuli/+question/240852

In my code, there is one line:

print os.path.dirname(__file__)

It works fine in my Eclipse.
-------------------------------------
But when I use it in SIkuli, SIkuli tells me:

[error] NameError ( name '__file__' is not defined )

-------------------------------------

So the questions are:

(1) Excuse me, is there a way to use "__file__" in Sikuli?

(2) If not, why?

(3) If I replace all the places which contain "__file__" to something related to "getImagePath()", is that ok?

I hope there is a way to use "__file__" because there are lots of places using "__file__", not only in my code, but also in the xlrd.
Thank you.

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