I Have an empty list which get its value from user's input a[] when I click on ( button) I need to print out the first element in the list and then when the user clicked again on the same button i need the second element in the list to be printed out and so forth. this is the button
self.button3 = wx.Button(self.panel, label="add word",size=(100,50),pos=(650,220))
self.button3.Bind(wx.EVT_BUTTON, self.buttonloop)
and this is the function that I want to call it whenever the button is clicked
def buttonloop(self,event):
os.chdir('d:/KKSC')
dic = getDic()
print dic[0], dic[1], dic[2]
text = tokenize_editor_text(self.control.GetValue())
a =[]
for word in text:
if word not in dic:
misspelled = word
a.append(misspelled)
for item in a:
print(item + " is an ape")
currentitem = item
b=a[item]
c=item.index
nextitem = a[c + 1]
print nextitem
# here I want to call the function again if the button clicked again
It doesn't work for me so far. any help is appreciated and if you didn't understand me well I will re-edit the post or I will explain more with comments