Converting a model into a Python script

It is also possible to automatically create Python code that performs the same task as the model itself. The code can then be used to create a console script. You can modify that script to incorporate actions and methods not available in the graphical modeler, such as loops or conditional statements.

This feature is also a very practical way of A) beginning to learn Python, B) using processing algorithms from the console, and C) creating new algorithms using Python code. You can use it as a learning tool when you start creating your own scripts.

To save your model as Python, click on the Export as Python script () tool. A dialog will prompt you to choose where you want to save the script. NOTE: This topic ...

Get Mastering QGIS - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.