gdesklets __import__ problem

  • Thread starter Thomas Dybdahl Ahle
  • Start date
T

Thomas Dybdahl Ahle

Hi, I'm writing a gdesklets control, that dynamicly uses __import__ and
getattr to get the right classes based on userinput. The problem is, that
my control is somehow being run from somewhere unknown. This means that
__import__ can't find the modules. I tried putting an
os.chdir("~/.gdesklets/Controls/1136298021.06/...") just before the
__import__ call, and that worked, but ofcource isn't very smart in the run.

Is there any way to find out where the control is put on the disk, so that
I can change to the correct folder? Or is there some hack, that allows me
to import the modules without knowing there location?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top