Check syntax without running python
Compile to bytecode only to catch syntax errors
python3 -m py_compile script.py && echo OK
more python
all 15 commands →
Format code with black
black --check --diff . && black .
Lint with ruff
ruff check . --fix
Type check with mypy
mypy --strict --ignore-missing-imports src/
Inspect object attributes
python3 -c "import json; print([x for x in dir(json) if not x.startswith('_')])"
Create virtual environment
python3 -m venv .venv && source .venv/bin/activate