Run module as script python
Serve current directory over HTTP on port 8080
python3 -m http.server 8080
more python
all 15 commands →
One-liner JSON pretty print
python3 -m json.tool < input.json
Profile script
python3 -m cProfile -s cumulative script.py | head -30
Debug with pdb
python3 -m pdb script.py
Set breakpoint in code
breakpoint() # Python 3.7+ — drops into pdb at this line
Run tests with pytest
pytest -x -v --tb=short tests/