[QGIS-Developer] QGIS variables in Python code

Andreas Neumann a.neumann at carto.net
Fri Nov 24 00:30:43 PST 2017


Hi, 

Thanks, Ismail and Nyall! 

Andreas 

On 2017-11-24 08:23, Nyall Dawson wrote:

> On 22 November 2017 at 21:21, Andreas Neumann <a.neumann at carto.net> wrote: 
> 
>> Hi,
>> 
>> Is it possible to query the value of a QGIS variable in Python code? E.g.
>> I'd like to find out in my code the full storage path to the folder of my
>> current QGIS project, which would be available in the @project_folder
>> variable.
> 
> Yes, as Ismail said.
> 
> However, in this case it's easier to just use the PyQGIS QgsProject
> API directly:
> 
> QgsProject.instance().fileName()
> 
> or
> 
> QgsProject.instance().homePath()
> 
> Nyall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20171124/db6c573f/attachment.html>


More information about the QGIS-Developer mailing list