Tkinter Reading Input Value from PopUp
You can store the value in a StringVar
variable and get()
its value.
import tkinter as tkfrom tkinter import StringVarclass PopUp(tk.Tk): def __init__(self): tk.Tk.__init__(self) tk.Label(self, text="Main Window").pack() popup = tk.Toplevel(self) popup.wm_title("EMAIL") popup.tkraise(self) tk.Label(popup, text="Please Enter Email Address").pack(side="left", fill="x", pady=10, padx=10) self.mystring = tk.StringVar(popup) self.entry = tk.Entry(popup,textvariable = self.mystring, bd=5, width=35).pack(side="left", fill="x") self.button = tk.Button(popup, text="OK", command=self.on_button) self.button.pack() def on_button(self): print(self.mystring.get())app = PopUp()app.mainloop()