Skip to content Skip to sidebar Skip to footer

AttributeError: 'str' Object Has No Attribute 'toInteger'

I'm writing a code using python to generate a point shapefile within ArcMAP. I have a 1000 random possibilities (in FileA), and I need to try all of them. The FileA is the index of

Solution 1:

Python doesn't have a toInteger() function for strings you will want to user int(entry[]) instead.


Solution 2:

There is no toInteger() method on strings in standard Python. The error message is pretty clear. If you want to convert a string like "37" to the integer 37, try int(entry) instead.

Why did you write toInteger() in your code?


Solution 3:

Does not exist toInteger method on strings Check this: http://docs.python.org/library/stdtypes.html#string-methods

The correct form is:

coordinates[int(entry)][0]

Post a Comment for "AttributeError: 'str' Object Has No Attribute 'toInteger'"