title: Python: How can I remove excel entries via openpyxl using a feedback loop?
body: <p>I am building a small app to study the vocabulary of various languages (see below the code for Mandarin). I have the basic funcions which work well. Now I want to add a button in my GUI where i can remove entries (i.e. individual words) from the database, once i have mastered the word (i.e. a button in tkinter which would remove the entry). After removing, the random function in python should then only select words from the reduced database. Do you have any idea how to do this? Any help is welcome! </p>
  
  <pre><code>from tkinter import *
  import random
  import sys
  import os
  randvalue_start = random.randint(2, 592)
  
  window = Tk()
  window.title('Mandarin Vocabulary')
  window.geometry('500x400')
  icon = PhotoImage(file = r'C:\Users\PycharmProjects\Mandarin\HSKlogopng.600px.png')
  icon2 = icon.subsample(5 ,5)
  label1 = Label(window, image = icon2, anchor="ne")
  
  
  import openpyxl
  path = r"\Users\PycharmProjects\Mandarin\characters.xlsx"
  worbook = openpyxl.load_workbook(path, read_only=True)
  sheet = worbook.active
  row_count = (sheet.max_row)
  
  
  def english_btn1():
      global randvalue_start
      english = f"B{randvalue_start}"
      english_value = sheet[english].value
      label_eng = Label(window, text=english_value+":", width=20, height=3, font=("TkDefaultFont",15))
      label_pin = Label(window, text="", font=30, width=15, height=3)
      label_mand = Label(window, text="", font=30, width=15, height=4)
      label_eng.grid(row=8,column=1,rowspan=2)
      label_pin.grid(row=8, column=2)
      label_mand.grid(row=9, column=2)
  
  def pinying_btn2():
      global randvalue_start
      pinying = f"C{randvalue_start}"
      mandarin = f"D{randvalue_start}"
      pinying_value = sheet[pinying].value
      mandarin_value = sheet[mandarin].value
      combined = f"{pinying}'/'{mandarin}"
      combined_value = f"{pinying_value}'/'{mandarin_value}"
      label_pin = Label(window ,text=pinying_value,font=("TkDefaultFont",15), width=10, height=2)
      label_mand = Label(window,text=mandarin_value,font=("TkDefaultFont",30), width=8,height=2, borderwidth=5,relief="ridge")
      label_pin.grid(row=8,column=2)
      label_mand.grid(row=9,column=2)
      randvalue_start = random.randint(2, 592)
  
  def reset():
       os.execl(sys.executable, sys.executable, *sys.argv)
  
  frame = LabelFrame(window,text="Input",padx=5, pady=5)
  frame.grid(row=0,column=1,padx=10,pady=10)
  
  
  btn2 = Button(frame,text = "Show answer", fg = "green" ,width=20 ,command=pinying_btn2)
  btn3 = Button(frame,text = "clear", fg= "red", width=20 ,command=reset)
  btn1 = Button(frame,text = "Next character", fg = "black" ,width=20,command=english_btn1)
  words_label = Label(frame,text = "# of characters: " + str(row_count))
  
  
  
  label1.grid(row=0,column=2, columnspan=2)
  Label(window, text="", width=20, height=3, font=("TkDefaultFont", 15)).grid(row=8, column=1)
  label_blk1 = Label(window, text="", font=("TkDefaultFont", 15), width=10, height=3).grid(row=8, column=2)
  label_blk2 = Label(window, text="", font=("TkDefaultFont", 30), width=10, height=2, padx=1, pady=1).grid(row=9, column=2)
  
  btn1.grid(padx=5, pady=5)
  btn2.grid(padx=5, pady=5)
  btn3.grid(padx=5, pady=5)
  words_label.grid(padx=5,pady=5)
  
  window.mainloop()
  </code></pre>