Reading files of an addon I write an exporter, which exports PBR materials, mostly from the PrincipledBSDF shader.  Would like to add a small directory of generic environment textures in my zip file, in a format that Blender does not use.  Like a 2 umbrella studio environment texture, seen here as a reflection texture.

User could then also pick from a custom property list, in addition to a the .hdr in the world node.  The file would get copied to the export directory.

Problem is how do I know where the directory from the addon is, in a completely OS independent way?
This gets the root directory of the add-on from any file (or at least those in the same directory).  Can always do an os.path.join() if I need a sub-directory.

def getAddonPath():
    import os
    return os.path.dirname(os.path.realpath(__file__))