Python's module-script utilities
The Python standard library offers many module-script utilities that can be used as command-line tools with the python -m
syntax.
python -m webbrowser https://pym.dev/p
open URL in default browserpython -m antigravity
open https://xkcd.com/353/python -m this
display the Zen of Python (PEP 20)python -m __hello__
printHello world!
python -m http.server
start a simple web serverpython -m json.tool
validate and pretty-print JSON data from stdin or filepython -m calendar
display a command-line calendarpython -m uuid
generate an UUID stringpython -m sqlite3
launch sqlite3 shellpython -m zipfile/gzip/tarfile
likezip/unzip
orgzip/gunzip
ortar
CLIpython -m base64
likebase64
CLIpython -m ftplib
likeftp
CLIpython -m pip
runpip
to install third-party packagespython -m venv
create an virtual environmentpython -m pydoc
show documentation for given stringpython -m pdb
run Python Debuggerpython -m unittest
run unittest tests from modules or filepython -m timeit
time a Python expressionpython -m site
display current Python environment info likesys.path
python -m platform
display OS informationpython -m encodings.rot_13
encode/decode text byROT13
cipher
More utilities and detailed explanation Python’s many command-line utilities
Was this page helpful?