Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 19, 2026·3 min de lecture

IPython — The Interactive Computing Shell for Python

IPython provides a rich interactive Python shell with tab completion, syntax highlighting, magic commands, and deep integration with the scientific Python stack.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
IPython Interactive Shell
Commande CLI universelle
npx tokrepo install 914e3787-5339-11f1-9bc6-00163e2b0d79

Introduction

IPython replaces the default Python REPL with a far more capable interactive environment. It powers Jupyter kernels and remains the go-to shell for data scientists, researchers, and developers who spend significant time exploring code interactively.

What IPython Does

  • Provides an enhanced interactive Python shell with syntax highlighting and auto-indentation
  • Supports magic commands (%timeit, %run, %debug) for common workflows
  • Offers introspection with ? and ?? to inspect any object or source code
  • Integrates with the OS shell via ! prefix for running system commands inline
  • Serves as the default kernel backend for Jupyter Notebook and JupyterLab

Architecture Overview

IPython is built around a read-eval-print loop that extends Python's standard code.InteractiveConsole. It uses a two-process model when running as a Jupyter kernel: a frontend (notebook or console) communicates with the IPython kernel over ZeroMQ sockets using the Jupyter messaging protocol. The core shell object manages namespaces, history, and magics as a plugin registry.

Self-Hosting & Configuration

  • Install via pip: pip install ipython or conda: conda install ipython
  • Configuration lives in ~/.ipython/profile_default/ipython_config.py
  • Create custom profiles with ipython profile create <name> for project-specific setups
  • Startup scripts placed in ~/.ipython/profile_default/startup/ run automatically on launch
  • Extensions load via %load_ext or by adding them to c.InteractiveShellApp.extensions in config

Key Features

  • Tab completion powered by Jedi with type-aware suggestions
  • Persistent input/output history with SQLite backend and %recall magic
  • Built-in debugger integration via %debug post-mortem and %pdb auto-trigger
  • Rich display protocol for rendering HTML, images, LaTeX, and SVG inline
  • Async/await support at the top level without wrapping in asyncio.run()

Comparison with Similar Tools

  • Standard Python REPL — no completion, no history search, no magics; IPython adds all of these
  • bpython — good completion and syntax highlighting but lacks magic commands and Jupyter integration
  • ptpython — built on prompt_toolkit with a nice UI but smaller ecosystem than IPython
  • Jupyter Notebook — uses IPython as its kernel; the notebook adds cell-based documents on top

FAQ

Q: Is IPython the same as Jupyter? A: No. IPython is the Python kernel and interactive shell. Jupyter is the notebook interface that can use IPython (or other language kernels) as a backend.

Q: Can I use IPython in production scripts? A: IPython is designed for interactive use. For production code, use standard Python. You can embed an IPython shell into a running program for debugging with IPython.embed().

Q: Does IPython support other languages? A: IPython itself is Python-only. The Jupyter protocol it helped create supports 100+ language kernels, but those are separate projects.

Q: How do I make IPython my default shell? A: Set your terminal profile or shell alias to launch ipython instead of python. For Jupyter, IPython is already the default Python kernel.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires