Hi George, On Thu, May 5, 2011 at 7:43 PM, George Corea <[email protected]> wrote: > When I run the script below in IDLE it gives the following output/ > errors > > Importing arcpy site package... > Setting workspace... > Z:\atGIS\training\Python_Alaska_Course\George\2 > Please enter output polygon shapefile name, including .shp > extensionggg.shp > Please enter longitude of lower left corner15 > Please enter latitude of lower left corner20 > Traceback (most recent call last): > File "Z:\atGIS\training\Python_Alaska_Course\George > \2\2_Create_Tiled_polygons.py", line 19, in <module> > origin = strX + ' ' + strY > TypeError: unsupported operand type(s) for +: 'float' and 'str'
You can't add a float and a string together. Python refuses to guess in the face of this kind of ambiguity. To debug this kind of problem, add a line before line 19 where the problem occurs, and set a breakpoint by typing: import pdb; pdb.set_trace() Then run again -- a debugging prompt will pop up, at which you can try >>> type(strX) or >>> type(strY) to find out which is not a float. Pdb is great for this. You'll want to use it all the time, and read its docs too. Cheers, -- Sean
