How to get a plugin path using Python? I tried QgsApplication.pluginPath()
I got u'/Applications/QGIS.app/Contents/MacOS/../PlugIns/qgis'
.
But I actually store the plugin in ~/.qgis2/python/plugins/myplugin
.
pyqgisqgisqgis-plugins
How to get a plugin path using Python? I tried QgsApplication.pluginPath()
I got u'/Applications/QGIS.app/Contents/MacOS/../PlugIns/qgis'
.
But I actually store the plugin in ~/.qgis2/python/plugins/myplugin
.
Best Answer
I use this in my plugins:
This is handy if you want a file relative to your plugin e.g
resolve('icon.png')
will return the full path to icon.png.Put this function inside a top level file for you plugin.