from tkinter import from tkinter messagebox import showinfo def reply(name)showinfo(title='reply'message='hello % !nametop tk(top title('echo'top iconbitmap('py-blue-trans-out ico'label(toptext="enter your name:"pack(side=topent entry(topent pack(side=topbtn button(toptext="submit"command=(lambdareply(ent get()))btn pack(side=lefttop mainloop(as isthis example is just three widgets attached to the tk main top-level windowlater we'll learn how to use nested frame container widgets in window like this to achieve variety of layouts for its three widgets figure - gives the resulting main and popup windows after the submit button is pressed we'll see something very similar later in this but rendered in web browser with html figure - fetching input from user the code we've seen so far demonstrates many of the core concepts in gui programmingbut tkinter is much more powerful than these examples imply there are more than widgets in tkinter and many more ways to input data from userincluding multiple-line textdrawing canvasespull-down menusradio and check buttonsand scroll barsas well as other layout and event handling mechanisms beyond tkinter itselfboth open source extensions such as pmwas well as the tix and ttk toolkits now part of python' standard librarycan add additional widgets we can use in our step adding gui