Questions tagged [nameerror]

Use when NameError from Python is thrown by your code

Filter by
Sorted by
Tagged with
6 votes
1 answer

Performing Ordinary Kriging in SAGA via QGIS SEXTANTE Plug-in?

I'm trying to learn how to apply the kriging analysis in QGIS using the SEXTANTE plug-in and SAGA tools. It appears that I have my SEXTANTE and SAGA folders configured properly according to the user ...
Patrick's user avatar
  • 271
0 votes
1 answer

NameError: name 'QImage' is not defined [closed]

Traceback (most recent call last): File "<input>", line 1, in <module> File "F:/QGIS/bin/", line 6, in <module> img = QImage(QSize(800,600), QImage....
roony's user avatar
  • 51
10 votes
1 answer

Adding PostGIS layer from QGIS Python plugin

I try to develop a plugin to add postgis layers to qgis from a plugin as part of learning python. The code for adding a postgis layer is taken from the cookbook and work fine if I run it from the ...
geogrow's user avatar
  • 1,633
9 votes
1 answer

Calling GRASS modules in pyQGIS?

I wish to use a Grass module ( in QGis, without the grass toolbox. I tried with the Python console, but to no avail : Using Sextante plugin but obviously it didn't know all the grass modules. ...
MarieA's user avatar
  • 91
3 votes
2 answers

Error msg "Name is not defined" when trying to populate a field with the shape file name

I am trying to populate a field with corresponding file name. For example, if the file name is Route1.shp then the field value will be Route1 as well. However my code is not working. Can you please ...
Python-Novice's user avatar
3 votes
2 answers

How to control state of buttons in Python Add-In?

I have bunch of buttons to perform separate tasks within a Python Add-In. Buttons are greyed out and required to be enabled after initial tools run. In the following example, tool1 is turned off after ...
Ibe's user avatar
  • 1,221
2 votes
1 answer

Using ArcObjects ITextSymbol.GetTextSize in Python to define two input variables that get populated by method

I am using Python 2.6 and ArcObjects in ArcGIS 10.0 to build and draw, among other things, graphic text on the current display. At one point I need to use the ITextSymbol.GetTextSize method. In a ...
celticflute's user avatar
  • 1,622
1 vote
4 answers

NameError: variable not defined even though set multiple times

This code original worked when run through the python command window in ArcCatalog. After I added the script to a toolbox I have had all sorts of troubles. The most frustrating error has been: ...
Caitlin's user avatar
  • 21
1 vote
1 answer

Correct SQL expression for SelectbyAttribute Tool [duplicate]

I'm trying to apply the sql expression described here, that involves querying out odd values in a field. The specific sql expression is Round(NumberField / 2, 0) &...
saoirse's user avatar
  • 246