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/popen URL in default browserpython -m antigravityopen https://xkcd.com/353/python -m thisdisplay the Zen of Python (PEP 20)python -m __hello__printHello world!python -m http.serverstart a simple web serverpython -m json.toolvalidate and pretty-print JSON data from stdin or filepython -m calendardisplay a command-line calendarpython -m uuidgenerate an UUID stringpython -m sqlite3launch sqlite3 shellpython -m zipfile/gzip/tarfilelikezip/unziporgzip/gunziportarCLIpython -m base64likebase64CLIpython -m ftpliblikeftpCLIpython -m piprunpipto install third-party packagespython -m venvcreate an virtual environmentpython -m pydocshow documentation for given stringpython -m pdbrun Python Debuggerpython -m unittestrun unittest tests from modules or filepython -m timeittime a Python expressionpython -m sitedisplay current Python environment info likesys.pathpython -m platformdisplay OS informationpython -m encodings.rot_13encode/decode text byROT13cipher
More utilities and detailed explanation Python’s many command-line utilities
Was this page helpful?