# Locating automatically my addon original folder

I've created a small addon, which wrap a much bigger addon. In the execute code, I want first to get the addon' path, add it to python path, and then import my main class and call its main function:

user_preferences = context.user_preferences

os.path.dirname(os.path.realpath(__file__))

• If the code above is in __init__.py in its own subfolder of the addons dir, (ie with the folder as a module) then os.path.dirname(__file__) will give you that subfolder, eg "/blender/2.77/scripts/addons/sound_drivers". Have a look at how some of the folder addons are set up using __init__.py – batFINGER Mar 30 '16 at 16:43