IPython Cheat Sheet - Useful IPython Magic Commands

Master IPython with this handy cheat sheet. Learn essential magic commands for enhanced productivity, including tips for managing your workflow, debugging, and more.

IPython Cheat Sheet

This cheat sheet provides a quick reference for useful IPython magic commands.

Working with IPython Profiles

Creating and Using Profiles

# Create a ipython profile
ipython profile create profile_name

# Use specified profile
ipython --profile=${profile_name}

Inspecting Your Workspace

Listing Defined Objects

%who

Managing Code

Creating and Running Macros

%macro

Using an External Editor

%edit

Exploring IPython's Capabilities

Listing Magic Commands

%lsmagic

Persistent Storage

%store

Debugging

Automatic Debugging

%pdb

Timing and Performance

Timing Expressions

%time
%timeit

Logging

Logging Input/Output

%logstart
%logon
%logoff
%logstate

Navigation

Directory Management

%cd
%pushd
%popd
%bookmark

Environment Control

Resetting the Environment

%reset

History

Viewing and Searching History

%hist
%hist -g somestring

Aliases

Listing Aliases

%alias

Embedding IPython

Embedding in Python Code

from IPython import embed; embed()