I'm certainly not the first one to encounter the problem. I have an
application with a gtk gui built using libglade. 

Right now, the glade file is in the same directory as the python file, and
this works as long as I launch the python script from that directory. I
would like to make things a bit more less 'hardcoded'. I've come up with
the following hack. Let's say the python module is called
my_application.py, and the glade file is my_application.glade. In the
module I have:

import my_application # import oneself
import os.path
GLADE_FILE = os.path.join(os.path.dirname(my_application.__file__),
                          'my_application.glade')

It does the job, but I'm not sure that this ios the right way of doing
things. Any comments ?


Alexandre Fayolle
-- 
LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Narval, the first software agent available as free software (GPL).

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to