##########################################################################################
# Create a Tkinter screen label and button
##########################################################################################
from tkinter import *			            #import entire tkinter framework
from tkinter import messagebox              #import popup dialogs 

def submitEvent( ):                                             #method is called upon submit
    messagebox.showinfo('Notice','You clicked on the button')   #display a popup dialog
 
#### Create the window components ###########################################################

win = Tk( )					                    #call Tk( ) constructor to create a root window
win.title("Tkinter Window with a button")	    #set a window title
win.geometry("200x100")                         #window size

frame1 = Frame(win)

nameLabel    = Label(frame1, text="Enter you name: ")                       #create components

submitButton = Button(frame1, width=9, text="Submit", command=submitEvent)  #call submit method upon submit

#### Place components in window ##############################################################

nameLabel.grid(   row=0,column=0, ipadx=5,ipady=10)         #with internal x/y padding
submitButton.grid(row=1,column=0, sticky='nesw')            #nesw = north/east/south/west

frame1.pack()                                               #make the frame visible
win.mainloop()                                              #make the window visible