if hasattr(sys, '_MEIPASS'):
    return os.path.join(sys._MEIPASS)
return os.path.join(os.path.abspath('.'))
if __name__ == '__main__':
    kivy.resources.resource_add_path(resourcePath())
Kivy: compiling to a single executable