3

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

4

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
4
  • 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. Commented 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... Commented 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. Commented Feb 6, 2017 at 18:37
  • Thanks anyway @Micha! I am looking for how to find out from within QGIS... specially the processing framework Commented Feb 7, 2017 at 17:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.