-3

Getting an error while inserting values from the tkinter GUi to the sqlite3 database. Taking input from the user

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685

1 Answers1

0

By the tone of your question, it seems like you are having trouble accessing what is inside the text box.

An answer would be the .get() method. This basically allows you to access what is inside the text box.

Here is a simple code:

from tkinter import *
window = Tk()
window.title("Example")
window.geometry("500x500")
window.configure(bg = "sky blue")
e = Entry(window, bg = "blue", fg = "orange")
e.pack()
def com1():
    acess = e.get()
    print(acess)
button1 = Button(window, text = "enter", command = com1)
button1.pack()

The e.get() is what takes the stuff inside the Entry widget.

You save it in a variable, then use the variable for whatever you want.

Hope this helps!!!