The variables of relevance for this are kx, ky and zi. You can just loop over them and print to a text file in desired format, although I would argue that any analysis or plotting you want to do might be better done in Python...
kvalues = ky[0]
for i in range(len(kvalues)):
for j in range(len(kvalues)):
print(kvalues[i], kvalues[j], zi[i,j])