How to return a value of a function given as a command in tkinter
问题 I've written a very simple code with python tkinter , it contains an input box. I'd like to keep the value inserted by the user to myself, in case I need to use it later. Here's the code: import tkinter as tk root=tk.Tk() root.geometry("600x400") def submit(): name=name_entry.get() return name name_label = tk.Label(root, text = 'Username', font=('calibre', 10, 'bold')) name_entry = tk.Entry(root, font=('calibre',10,'normal')) sub_btn=tk.Button(root,text = 'Submit', command = submit) name