不是完整列表...
Encoding
Base64 编码/解码:
python -m base64 -d [file]
python -m base64 -e [file]
ROT-13 编码/解码器:
python -m encodings.rot_13
Macintosh BinHex:
# binhex <file> to <file>.hqx, and unbinhex <file>.hqx to <file>.viahqx
python -m binhex <file>
UU编码/解码:
python -m uu [infile [outfile]] # encode
python -m uu -d [infile [outfile]] # decode
MIME 引用-可打印编码/解码:
python -m mimify -e [infile [outfile]] # encode
python -m mimify -d [infile [outfile]] # decode
引用-可打印编码/解码:
python -m quopri [file] # encode
python -m quopri -d [file] # decode
压缩
GZip:
python -m gzip [file] # compress
python -m gzip -d [file] # decompress
Zip文件提取等:
python -m zipfile -l <file> # list
python -m zipfile -t <file> # test
python -m zipfile -e <file> <dir> # extract
python -m zipfile -c <file> sources... # create
Internet
HTTP 服务器:
python -m BaseHTTPServer
python -m CGIHTTPServer
python -m SimpleHTTPServer
简单的FTP客户端:
python -m ftplib host [-l<dir-to-list>] [-d<dir-to-cwd>] [-p] [file-to-retrieve]
HTML 文本提取:
python -m htmllib <file>
JSON 验证器和漂亮的打印机:
python -m json.tool [infile [outfile]]
列出 POP3 邮箱:
python -m poplib <server> <username> <password>
SMTP 服务器:
python -m smtpd
发送邮件消息(到本地主机):
python -m smtplib
远程登录客户端:
python -m telnetlib [host [port]]
MIME 类型/扩展名数据库:
python -m mimetypes file.ext # print type for filename
python -m mimetypes -e mime/type # print extension for type
打开网络浏览器:
python -m webbrowser -n <url> # new window
python -m webbrowser -t <url> # new tab
反重力 http://xkcd.com/353/:
python -m antigravity
Python
纯Python REPL:
python -m code
Python字节码批量编译器:
python -m compileall
Python 代码分析器:
python -m cProfile <script>
python -m profile <script>
python -m pstats <filename> # print profiling statistics
Python 文档测试执行器:
python -m doctest <script>
Python 基准测试:
python -m test.pystone [iterations]
python -m hotshot.stones
Python交互式调试器:
python -m pdb
从模块中提取 Python 类和方法:
python -m pyclbr <script>
Python 文档浏览器:
python -m pydoc <topic>
python -m pydoc -g # graphical browser
python -m pydoc -p <port> # start HTTP docs server on port
Python 片段计时器:
python -m timeit
Misc
日历(如cal
,但可以执行 HTML 和各种花哨的格式化内容):
python -m calendar
目录比较器:
python -m filecmp [-r] dir1 dir2 # -r for recursive directory compare
段落格式:
python -m formatter [file]
显示当前平台(例如uname
但更简单):
python -m platform