tkinter allign

from Tkinter import *		#      N=North
root = Tk()					#   W=West E=East
							#     S = South
example = Label(root, text="Hello World!")	
example.grid(row=1, column=1, sticky=W)		

Here is what the above code is Doing:
1. It’s creating a Tkinter root window.
2. It’s creating a Tkinter label.
3. It’s placing the label in the root window.
4. It’s setting the sticky attribute of the label to W, which means that the label will stick to the west side of the root window.

The sticky attribute is one of the ways you can control the placement of widgets in a grid.

The sticky attribute can take one of the following values:

N, E, S, W, or NE, SE, SW, NW

These values tell Tkinter to stick the widget to the north, east, south, or west side of the cell.

You can also use two values at the same time, like this:

sticky=N+E

This will stick the widget to the north and east sides of the cell.

You can also use the constants NSEW (or NWSE, NESW, etc.), like this:

sticky=NSEW

This will stick the widget to all four sides of the cell.

You can also use the constants NS and EW, like this:

sticky=NS

This will stick the widget to the north and south sides of the cell.

You can also use the constants NONE or CENTER, like this:

sticky=NONE

This will center the widget in the cell.

You can also use the constants ALL, which is the same as NSEW.

The sticky attribute is just one of the ways you can control the placement of widgets in a grid.

There are also the row and column configuration options.

The row and column configuration options are used to tell Tkinter which row and column a widget should be in.

The row and column configuration options can be used like this:

row=0, column=1

This will place the widget in row 0, column 1.

The row and column configuration options can also be used like this:

rowspan=2, columnspan=3

This will make the widget span 2 rows and 3 columns.

The row and column configuration options can also be used like this:

ipadx=10, ipady=5

This will add 10 pixels of padding to the left and right sides of the widget, and 5 pixels of padding to the top and bottom sides of the widget.

The row and column configuration options can also be used like this:

padx=10, pady=5

This will add 10 pixels of padding to the left and right sides of the widget, and 5 pixels of padding to the top and bottom sides of the widget.

The row and column configuration options can also be used like this:

sticky=N+E

This will stick the widget to the north and east sides of the cell.

The row and column configuration options can also be used like this:

sticky=NSEW

This will stick the widget to all four sides of the cell.

The row and column configuration options can also be used like this:

sticky=NS

This will stick the widget to the north and south sides of the cell.

The row and column configuration options can also be used like this:

sticky=NONE

This will center the widget in the cell.

The row and column configuration options can also be used like this:

sticky=ALL

This is the same as NSEW.