0

i am working with sqlite and tkinter. my words being saved in table are written in lowercase. i want the entry widget to accept uppercase and lowercase. so when i input the word in either uppercase or lowercase, the definition will show up. this is my code. what should i add to it to achieve my aim

root = tk.Tk()
root.geometry("400x265")
root.resizable(width=False, height= False)
root.title("Dic")
root.configure(background='skyblue')
########### DEF FOR SEARCH #######
def search():
    conn= sqlite3.connect('Example.db')
    cur= conn.cursor()
    data= v.get()
    data.upper()
    cur.execute("SELECT definition FROM tables WHERE Word= ?", (data,))
    var= cur.fetchone()
    tex.delete(1.0,"end")
    tex.insert("end", var)
Temitope
  • 27
  • 5
  • `data.upper()` returns an uppercase version of data. It doesn't amend data. Try `data = v.get().upper()`. In your question you refer to lowercase in your table. Should you use lower instead of upper? – Tls Chris Mar 21 '20 at 13:55
  • It is nothing related to tkinter `Entry`. It depends on whether sqlite supports case insenitive query. – acw1668 Mar 21 '20 at 14:46
  • Does this answer your question? [How to set Sqlite3 to be case insensitive when string comparing?](https://stackoverflow.com/questions/973541/how-to-set-sqlite3-to-be-case-insensitive-when-string-comparing) – acw1668 Mar 21 '20 at 15:44

0 Answers0