From the course: Learning QGIS

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Using the Python Console

Using the Python Console - QGIS Tutorial

From the course: Learning QGIS

Start my 1-month free trial

Using the Python Console

- [Instructor] Python is a powerful way to access the QGIS API. Automating tasks, such as adding and removing layers, filtering data, or even exporting information, can be done using Python with QGIS. Let's get our map set up first. I'm going to add the parcels to my current map, and then I'm going to open up the Python console, There's two ways to do that. You can go under plugins, and pick the Python console, or alternatively, there's a Python console toggle button in the toolbar. The Python console basically gives you two areas, an area where you can type in commands and the area that shows what you've been entering. We can type any command we want here, so what we can do with these commands, for example, say I wanted to get the active layer. So, first of all, I'm going to highlight parcels, and say the layer is in my interface, my active layer. As you can see, as I was typing, it was giving me auto complete. So…

Contents