Real Python
  • Start Here
  • Learn Python
    Python Tutorials →
    In-depth articles and video courses
    Learning Paths →
    Guided study plans for accelerated learning
    Quizzes & Exercises →
    Check your learning progress
    Browse Topics →
    Focus on a specific area or skill level
    Community Chat →
    Learn with other Pythonistas
    Office Hours →
    Live Q&A calls with Python experts
    Podcast →
    Hear what’s new in the world of Python
    Books →
    Round out your knowledge and learn offline
    Reference →
    Concise definitions for common Python terms
    Code Mentor →Beta
    Personalized code assistance & learning tools
    Unlock All Content →
  • More
    Learner Stories Python Newsletter Python Job Board Meet the Team Become a Tutorial Writer Become a Video Instructor
  • Search
/
  • Join
  • Sign‑In

— FREE Email Series —

🐍 Python Tricks 💌

Python Tricks Dictionary Merge

🔒 No spam. Unsubscribe any time.

Browse Topics Guided Learning Paths
Basics Intermediate Advanced
ai algorithms api best-practices career community databases data-science data-structures data-viz devops django docker editors flask front-end gamedev gui machine-learning news numpy projects python stdlib testing tools web-dev web-scraping

Table of Contents

  • Getting to Know the Python Standard REPL
    • What Is Python’s Interactive Shell or REPL?
    • Why Use a Python REPL?
  • Starting and Terminating REPL Interactive Sessions
    • Running the python Command
    • Passing Command-Line Options to the python Command
    • Exiting the Current Python REPL Session
  • Running Code in a REPL Session
    • Evaluating Expressions and Simple Statements
    • Running Compound Statements
    • Dealing With Explicit and Implicit Line Continuations
    • Printing vs Evaluating
    • Flagging and Understanding Errors
    • Using the _ Implicit Variable
    • Reloading Imported Modules
  • Editing Code in the Python REPL
    • Code History and Navigation
    • Auto-Indentation
    • Safe Multiline Paste and Paste Mode
    • Quick REPL Commands
    • Code Autocompletion
    • Syntax Highlighting
  • Getting Help and Introspecting Code in the REPL
    • Using Python’s Built-in Help System
    • Introspecting Your Code Dynamically
  • Customizing the Standard REPL
    • Providing a Startup File
    • Colorizing REPL Output for Python Before 3.13
    • Customizing the Color Theme in Python 3.14 and Later
  • Uncovering Missing Features in the Standard REPL
  • Using an Alternative REPL
  • Conclusion
  • Frequently Asked Questions

Recommended Video Course
Getting the Most Out of the Python Standard REPL