Display Search Cursor Results in tkMessageBox

692
2
Jump to solution
09-27-2013 09:14 AM
BradShore1
New Contributor
Hi,

I am trying to display results that did not match from geocoding that displays Member IDs in a tkMessageBox. The code below seems to work (the last print statement shows the expected IDs), but the tkMessageBox only displays the last value in the valueList. Any advice on how to display all of the values in the valueList in the tkMessageBox would be greatly appreciated.

Thanks,
B

import arcpy, tkMessageBox  input_MEM = r"C:\test.gdb\Members" field = "MEM_ID"  valueList = [] rows = arcpy.SearchCursor(input_MEM,"\"Loc_name\" IS NULL","",field,"")  for row in rows:     value = row.getValue(field)     if value not in valueSet:         valueList.append(value)          for ID in valueList:         print ID  tkMessageBox.showinfo("Process Completed","Member(s) " + str(ID) + " could not be located.")
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JasonScheirer
Occasional Contributor III
tkMessageBox.showinfo("Process Completed","Member(s) " + ", ".join(str(ID) for ID in valueList) + " could not be located.")

View solution in original post

0 Kudos
2 Replies
JasonScheirer
Occasional Contributor III
tkMessageBox.showinfo("Process Completed","Member(s) " + ", ".join(str(ID) for ID in valueList) + " could not be located.")
0 Kudos
BradShore1
New Contributor
Perfect, thank you!
0 Kudos