I want to have a tkinter gui that has an entry widget along with a button that a user can enter a number into the entry field then click the "submit" button. When the button is pressed I want his entry to store to a database I have set up.
my code so far is as follows:
db = Mysqldb.connect('localhost', 'root', '----', '----', 'design')
cursor = db.cursor()
def submit_it():
cursor.execute('INSERT INTO time VALUES (data.get())')
data = Entry(gui2, text = 'food name')
data.place(x=100,y=100)
submit = Button(gui2, text = 'submit', command = submit_it())
submit.place(x=200,y=200)
any ideas on how I could get this to work would be greatly appreciated... again, all I am wanting to do is have the user input something into the entry field and click the submit button. when this is done his entry will get saved into my database :)