P4 - Python Programming for GIS
These scripts were generated while reading through the The PyQGIS Programmers Guide. These and the scripts for Chapter 10, 11, and 12 (WhereAmI, compile, interactive, etc.) can be downloaded here (the data directory was obtained for here).
I strongly urge you to attempt the content in Chapter 10, 11, and 12 on your own before referring to the provided code.
Also, the next major release of QGIS should transition this API to Python 3.X, but that should not affect these tutorials too much.
Additional support can be found in the QGIS Python Cookbook (information on the Python and C++ API are here as well).