Run module as script
Serve current directory over HTTP on port 8080
python3 -m http.server 8080
More python commands
-
python3 -m json.tool < input.jsonPretty-print a JSON file using stdlib
-
python3 -m cProfile -s cumulative script.py | head -30CPU profiling sorted by cumulative time
-
python3 -m pdb script.pyStart script under the Python debugger
-
breakpoint() # Python 3.7+ — drops into pdb at this lineBuilt-in breakpoint() is equivalent to import pdb; pdb.set_trace()
-
pytest -x -v --tb=short tests/Stop at first failure, verbose, short traceback