The
latitude_entry
control is a text box, so when you call
isinstance
on the content, it returns false because the text "2" is not an integer, it is a string of characters.
You need to try to convert it to an integer, and handle the exception raised when it is not a valid number; something like:
lat = latitude_entry.get()
try:
x = int(lat)
except ValueError:
print(lat, "is not a number") // take other action here
You need to add some messaging code inside the
except
block.