Interactive console

Whether you use MS Windows or Linux, you should have QGIS installed with Python console. We will use it now to determine system version.

Go to Plugins ‣ Python console (Ctrl+Alt+P). This should open a new window with an interactive console.


Fig. 1 Interactive Python console in QGIS.

After you open Python console, you should see these buttons:

Clear window contents and delete all displayed text
Run command. You can use this button or just simply press Enter
Opens a text editor. You can edit your code through it
Advanced settings of console and editor
This will launch web browser with help manual

Python console gives us option to write code more interactively. Moreover the console supports syntax highlight. You can also save your code to a file. When you press Ctrl-Alt-Space, it will automatically insert commands. To see history of commands, press Ctrl-Shift-Space.

Let’s start with a command:

>>> _pyqgis

which display documentation for Python in QGIS as a new tab in web browser.


>>> _api

will also display C++ API documentation.


Built-in code editor can be open by clicking on icon showEditorConsole. Automatic prompting (Ctrl+Space) can be very useful while writing a code. To check code syntax, press (Ctrl+4). Another useful functions are search in code and inspect the code.


Fig. 2 Built-in Python code editor.