# Python Tkinter Module

Tkinter is the standard GUI (Graphical User Interface) library for Python. It provides a fast and easy way to create GUI applications.

## Importing the Module

```python
import tkinter as tk
```

## Basic Window

```python
import tkinter as tk

root = tk.Tk()
root.title("My App")
root.geometry("300x200")

# Start the event loop
root.mainloop()
```

## Widgets

### Label

```python
label = tk.Label(root, text="Hello World")
label.pack()
```

### Button

```python
def on_click():
    print("Button clicked!")

btn = tk.Button(root, text="Click Me", command=on_click)
btn.pack()
```

### Entry (Input)

```python
entry = tk.Entry(root)
entry.pack()

def get_input():
    print(entry.get())
```

## Layout Managers

*   `pack()`: Packs widgets in blocks before placing them in the parent widget.
*   `grid()`: Places widgets in a 2D table.
*   `place()`: Places widgets at a specific position.

```python
# Grid Example
label1 = tk.Label(root, text="Name")
label1.grid(row=0, column=0)

entry1 = tk.Entry(root)
entry1.grid(row=0, column=1)
```

[[programming/python/python]]