Tkinter Tutorial 2

Ok following on from part one, we can now add a lable to our window.  This can be done with 2 lines of code., add before the line window.mainloop()

#define labeles
box1 = Label(window, text="Entry 1: ")
 
#place labels
box1.grid(row = 1	, column = 1, padx = 5, pady = 5)

The first line defines the label object,  the 2nd Line places the label on the window.

You should end up with something like this, again note the # for the comments in code.

label1

 

 

 

 

 

 

 

 

 

 

 

I have called it entry one,  but what the label says is not really important.

That is pretty much it.