()
return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding())
This will get us the program's directory, even if we are frozen
    using py2exe
This will get us the program's directory, even if we are frozen
    using py2exe
This will get us the program s directory even if we are frozen using py2exe
def modulePath():
    """
    This will get us the program's directory, even if we are frozen
    using py2exe
    """

    try:
        _ = sys.executable if weAreFrozen() else __file__
    except NameError:
        _ = inspect.getsourcefile(modulePath)

    return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding())
def modulePath ( ) : try : _ = sys . executable if weAreFrozen ( ) else __file__ except NameError : _ = inspect . getsourcefile ( modulePath ) return getUnicode ( os . path . dirname ( os . path . realpath ( _ ) ) , encoding = sys . getfilesystemencoding ( ) )