I am starting to develop a plugin for Qgis using python, which i am very new at, and would like to view some results of variables by displaying a message in QGIS. How can I do this?

  • Isn't Plugins->Python_console enough for you? – SS_Rebelious Oct 24 '12 at 8:28
  • The Python console isn't really meant for that. – Nathan W Oct 24 '12 at 8:53
  • 2
    Do you mean you want to show a message box with some values. – Nathan W Oct 24 '12 at 8:53
  • Yes, I would like to show a message box with some values – GreyHippo Oct 25 '12 at 0:58
some_variable = feature.geometry()   

QMessageBox.information(None, "DEBUG:", str(some_variable)) 
  • How come this won´t work as a class while running it as sys import-script in the console editor? – CARTOS Jan 25 '16 at 20:08

Another good option is the message log.

from qgis.core import QgsMessageLog


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.