| __hello__ |
Hello world! |
python -m __hello__ |
| antigravity |
Open browser with http://xkcd.com/353 |
python -m antigravity |
| ast |
Parse abstract syntax tree for a Python module |
python -m ast myfile.py |
| asyncio |
Asyncio REPL |
python -m asyncio |
| base64 |
Encode and decode base64 |
echo 'message' | python -m base64 -e |
| cProfile |
Profiling your code |
python -m cProfile module.py |
| calendar |
Pretty print a calendar |
python -m calendar |
| code |
Closely emulate the interactive Python interpreter |
python -m code |
| compileall |
Compile Python source files in a directory tree |
python -m compileall |
| dis |
Print bytecode generated by a file |
python -m dis some_module.py |
| doctest |
Run doctests in a file |
python -m doctest myfile.py |
| encodings.rot_13 |
ROT-13 encoder/decoder |
echo 'message' | python -m encodings.rot_13 |
| ensurepip |
Bootstrap pip if it was skipped or uninstalled |
python -m ensurepip |
| filecmp |
Compare two directories content |
python -m filecmp dir_a dir_b |
| ftplib |
Simple ftp client |
python -m ftplib [host] |
| gzip |
Compress and decompress files |
python -m gzip [file] |
| http.server |
Simple HTTP Server |
python -m http.server 5000 |
| idlelib |
Launch IDLE prompt |
python -m idlelib |
| imaplib |
Like using curl to read email |
python -m imaplib [imap4 host] |
| inspect |
Inspect a object. |
python -m inspect "collections:OrderedDict" |
| json |
Validate and pretty-print JSON (3.14+) |
echo '{ "key": 3.4}' | python -m json |
| json.tool |
Validate and pretty-print JSON (soft deprecated) |
echo '{ "key": 3.4}' | python -m json.tool |
| locale |
Show O.S Locale information |
python -m locale |
| mimetypes |
MIME type/extension database |
python -m mimetypes -e application/json |
| pdb |
Automatic post-mortem debugging |
python -m pdb myscript.py |
| pickle |
Display contents of the pickle files |
python -m pickle [pickle files] |
| pickletools |
Disassemble one or more pickle files |
python -m pickletools [pickle file] |
| pip |
Python package manager |
python -m pip install requests |
| platform |
Show current platform |
python -m platform |
| poplib |
List POP3 mailbox |
python -m poplib [server] [username] [password] |
| profile |
Profiling your code (deprecated, removed in 3.17) |
python -m profile some_module.py |
| profiling.sampling |
Sampling profiler (3.15+) |
python -m profiling.sampling run script.py |
| profiling.tracing |
Deterministic profiler, cProfile alias (3.15+) |
python -m profiling.tracing script.py |
| pstats |
Print profiling statistics |
python -m pstats [file generated by profile] |
| py_compile |
CLI to "compile" a .py file to a .pyc |
python -m py_compile [filenames] |
| pyclbr |
Extract classes and methods from a module |
python -m pyclbr [module] |
| pydoc |
Consult the documentation |
python -m pydoc -b |
| quopri |
Encode and decode MIME quoted-printable data |
echo 'message' | python -m quopri |
| random |
Generate random values |
python -m random -c blue yellow green |
| runpy |
Run a Python module as a script |
python -m runpy __hello__ |
| shlex |
Tokenize input using shell-like syntax |
echo 'echo "hi" | grep x' | python -m shlex |
| site |
List your current path |
python -m site |
| smtplib |
Send a mail message(to localhost) |
python -m smtplib |
| sqlite3 |
SQLite shell |
python -m sqlite3 |
| symtable |
Access to the compiler’s symbol tables |
python -m symtable [python file] |
| sysconfig |
Shows paths and Python internal variables |
python -m sysconfig |
| tabnanny |
Check file for mixed tabs & spaces |
python -m tabnanny [python file] |
| tarfile |
Read and write tar files |
python -m tarfile -e myfile.tar |
| this |
Zen of python |
python -m this |
| timeit |
Measuring execution time of small code snippets |
python -m timeit 'sorted(range(100))' |
| tkinter |
Open a small Tk demo window |
python -m tkinter |
| tokenize |
Show how python tokenize a file |
python -m tokenize some_module.py |
| trace |
Trace Python program or function execution |
python -m trace --trackcalls [python file] [name] |
| turtle |
Demo of old turtle.py |
python -m turtle |
| turtledemo |
Educational demos for turtle module |
python -m turtledemo |
| unittest |
Run tests using unittest |
python -m unittest . |
| uuid |
Generate a random UUID |
python -m uuid |
| venv |
Create a virtual enviroment |
python -m venv myproject |
| webbrowser |
Open a web browser |
python -m webbrowser http://httpbin.org |
| zipapp |
Create an executable ZIP file from Python code |
python -m zipapp mydir -m "module:main" |
| zipfile |
Zip operations like create, test or extract |
python -m zipfile -e zipfile.zip target |