Python REPL Guide
Beginner Satellite
Python REPL
The Read-Eval-Print Loop (REPL) is your scratchpad. Learn hotkeys, helper functions, and productivity tips.
Launch
python
# or
python -i script.py # run script then stay in REPL
Use exit() or Ctrl+D (Ctrl+Z on Windows) to leave.
Useful helpers
| Helper | Description |
|---|---|
help(obj) | Opens documentation on any object |
dir(obj) | Lists attributes/methods |
_ | Stores last returned value |
import this | Zen of Python |
Productivity tips
- Enable tab completion by installing
readline(pip install gnureadlineon macOS). - Use IPython for richer history, magics, and syntax highlighting.
- Recall previous commands with arrow keys or
Ctrl+R.