Archive For The “Python” Category

Python Disabled in QGIS?

This afternoon, I opened QGIS, and was greeted with a strange error message: Couldn’t load PyQGIS. Python support will be disabled. Traceback (most recent call last): File “”, line 1, in RuntimeError: the PyQt4.QtCore module is version 1 but the qgis.core module requires version -1 QGIS will still open if Python support is disabled, but […]

Read more »

if Python

In some ways, Python is a very user-friendly language.  But it can be very finicky about indentation.  Instead of relying on white space and parentheses to impart structure, it uses exacting syntax.  To an inexperienced programmer, this is not a problem – in fact, it makes writing scripts very easy to learn.  Experienced programmers, on […]

Read more »

break if try

The Python programming language, which has become the standard for scripting in ArcGIS 10.x, is quite versatile, and has a very natural language style.  One specific difference from earlier languages (like C) is that variables don’t have to be declared or cast.  Instead, they can be declared and assigned in the same statement.  Variables have […]

Read more »