# L-30 MCS 260 Mon 5 Nov 2007 : guihello2.py # # Hello world with a Graphical User Interface. # After displaying "Who's there?", the user # can type in a name, and after pressing the # enter button, a new window will pop up, # displaying hello followed by the name. from Tkinter import * import tkMessageBox top = Tk() Label(top,text="Who's there ? ").grid(row=0) e = Entry(top) e.grid(row=0,column=1) def hello(): "opens a window to say hello" s = 'hello ' + e.get() tkMessageBox.showinfo("enter",s) b = Button(top,text="enter",command=hello) b.grid(row=1,column=1) top.mainloop()