1

I need to make my plugin to read the address of another plugin. This index will vary depending on the user logged in on windows. How to make?

plugin = os.path.dirname(os.path.abspath(__file__)) - This path my plugin

(D:\Users\Mike\.qgis2\python\plugins\forceplugin) - IT's Ok.

templates =  os.path.abspath('/.qgis2\python\plugins\gotplugin\templates)

This path my other plugin result:

(C:\.qgis2\python\plugins\gotplugin\templates) - :(

I Want the result:

(D:\Users\Mike\.qgis2\python\plugins\gotplugin\templates)

2

Use this

from qgis.core import QgsApplication
template=QgsApplication.qgisSettingsDirPath() + "python/plugins/gotplugin/templates"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.