from tkinter import * root=Tk() def result(w): print(w.get()) t=Entry(root,width="8") t.grid(column=1,row=2) result(t)