# IPython: Enhanced Python Interactive Shell


IPython is an enhanced interactive Python interpreter that provides a powerful command-line interface with advanced features like syntax highlighting, tab completion, magic commands, and rich display capabilities. It serves as the computational kernel for Jupyter notebooks.

## Core Features

### Enhanced Interactive Shell

- Syntax Highlighting: Real-time code coloring for better readability
- Tab Completion: Intelligent autocompletion for objects, methods, and file paths
- History Management: Persistent command history with search capabilities
- Rich Output: Native display of images, plots, and formatted data structures
- Object Introspection: Detailed information about objects using `?` and `??`

### Magic Commands

IPython provides magic commands prefixed with `%` for single-line operations or `%%` for cell-wide operations:

```python
%timeit sum(range(100))           # Time execution
%debug                            # Enter debugger
%matplotlib inline                # Enable inline plotting
%%writefile script.py             # Write cell contents to file
```

### Integration Capabilities

- Jupyter Kernel: Powers Jupyter notebooks and JupyterLab
- Shell Integration: Execute system commands with `!`
- Editor Integration: Works with vim, emacs, and modern IDEs
- Debugger: Built-in IPython debugger with enhanced features

## Installation and Usage

### Basic Installation

```bash
# Install with uv
uv tool install ipython

# Or add to project
uv add ipython
```

### Starting IPython

```bash
# Launch IPython shell
ipython

# Run a script in IPython
ipython script.py

# Start with specific profile
ipython --profile=myprofile
```


## Pros

- Improved interactive experience over standard Python REPL
- Extensive magic command system for common tasks
- Rich display capabilities for data analysis
- Strong integration with scientific Python ecosystem
- Persistent history and session management

## Cons

- Additional dependency overhead compared to standard Python

## Learn More

- [How to run the IPython shell in your uv project](https://pydevtools.com/handbook/how-to/how-to-run-the-ipython-shell-in-your-uv-project.md)
- [How to run a Python REPL with uv](https://pydevtools.com/handbook/how-to/how-to-run-a-python-repl-with-uv.md)
- [How to run a Jupyter notebook with uv](https://pydevtools.com/handbook/how-to/jupyter-notebook-with-uv.md)
- [How to set up auto-reload for Python projects](https://pydevtools.com/handbook/how-to/how-to-set-up-auto-reload-for-python-projects.md)
- [IPython Documentation](https://ipython.readthedocs.io/)
- [Magic Commands Reference](https://ipython.readthedocs.io/en/stable/interactive/magics.html)
- [Configuration Guide](https://ipython.readthedocs.io/en/stable/config/intro.html)
