Getting an error while inserting values from the tkinter GUi to the sqlite3 database. Taking input from the user
Asked
Active
Viewed 28 times
-3
-
Welcome to Stack Overflow!! Please supply your code. – Apr 01 '19 at 19:23
-
Are you using an `Entry()` widget? If you do, then I have the answer. Otherwise, please do tell what widgets you are using, and your code would also help. Thanks!! – Apr 02 '19 at 04:15
-
Yeah I'm using the entry widget! – Rishi Jaiswar Apr 02 '19 at 06:20
-
You need to show some code that exhibits this problem, and show the actual error you are getting. – Bryan Oakley Apr 02 '19 at 18:14
-
@RishiJaiswar are you having trouble getting what's inside the the textbox? – Apr 02 '19 at 21:08
1 Answers
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!!!