So I want to create a window which will cycle through the terms when clicked, and also flip the card when other button clicked, and its all working, but the button can only click once. I click the fist time, and the next word comes up, but the second time, nothing happens. This is the same for both buttons.
def flashCard():
global i
global j
i=0
j=0
word = tmp[0][0]
flashCard1 = Toplevel()
flashCard1.title("Flash Cards!")
flashCard1.geometry("450x200")
term = Label(flashCard1, text=word, font=("Helvetica", 32, "bold"))
term.grid(row=0, column=0, padx=150, pady=75, columnspan=2)
def flip(i,j):
if j == 0:
term.configure(text=tmp[i][1])
elif j == 1:
term.configure(text=tmp[i][0])
def nextC(i,j):
i=i+1
try:
term.configure(text=tmp[i][0])
except:
messagebox.showinfo("Error", "No more cards - back to beginning")
i=0
term.configure(text=tmp[i][0])
flipBtn = Button(flashCard1, text="See other side", command=lambda: flip(i,j))
flipBtn.grid(row=1, column=0)
nextBtn = Button(flashCard1, text="See next card", command=lambda: nextC(i,j))
nextBtn.grid(row=1, column=1)
Thanks!