I been using os.path.abspath(sys.argv[0])
for getting the path where my exe runs always (doesn't matter where it was executed from) but python 2.x there is a problem with sys.argv http://bugs.python.org/issue2128 with unicode trying to use the script path for glade (PYGTK) file
self.gladeloc = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),"file.glade")
print self.gladeloc #prints fine C:\Users\фдсфгс\Desktop\ using idle console
self.builder.add_from_file(self.gladeloc) #prints C:\Users\пїЅпїЅпїЅ\Desktop\
I get the following error is there alternative for getting exe location on disk (doesnt matter where opened) i have searched other questions and it seems there is no alternative without 2 problems
1 get files location even if executed from different place
2 unicode/utf-8 support pygtk doesn't support python 3 (fixed sys.argv) so I can't just upgrade