When you are running python scripts in QGIS via the QGIS own's python console or from a QGIS plugin (when using algorithms from the processing framework).
How to know or even change the version of GRASS that is being used?
This question came up while discussing this other question.
asked Jan 25, 2017 at 15:49
1 Answer 1
In the console: g.version
.
In a plugin, the python expression:
import grass.script as gscript
ver = gscript.run_command('g.version')
answered Jan 25, 2017 at 17:21
-
sorry I missed your answer. I meant inside the QGIS python console... In QGIS it seems that the grass scripts are commonly used via the processing framework which uses this format to call algorithms from grass and other providers: processing.runalg(name_of_the_algorithm, ...). I updated the question's text to be more accurate.eglatorre– eglatorre2017年02月06日 10:00:20 +00:00Commented Feb 6, 2017 at 10:00
-
is it possible to use this grass.script outside of GRASS console or from a plugin in QGIS directly? I think that is what this Processing framework achives somehow...eglatorre– eglatorre2017年02月06日 10:17:31 +00:00Commented Feb 6, 2017 at 10:17
-
In the QGIS GRASS Plugin, you can open a console and run g.version. I don't know about the Processing Toolbox.Micha– Micha2017年02月06日 18:37:57 +00:00Commented Feb 6, 2017 at 18:37
-
Thanks anyway @Micha! I am looking for how to find out from within QGIS... specially the processing frameworkeglatorre– eglatorre2017年02月07日 17:52:38 +00:00Commented Feb 7, 2017 at 17:52
lang-py