from tkinter import * root = Tk() example = Label(root, Text="Hello World!", borderwidth="2", relief="groove") # Releif is the effect what goes with the border. #" flat", "raised", "sunken", "ridge", "solid" are relief commands too. root.mainloop()
Here is what the above code is Doing:
1. We create a Label widget.
2. We pass it the root window as its master.
3. We pass it the text “Hello World!”.
4. We give it a border width of 2.
5. We give it a relief of “groove”.
6. We tell the root window to enter its main loop.