Py't'hon语言与Linux系统管理
Py't'hon生态工具
打造命令行工具
文本处理
Linux系统管理
使用python监控Linux系统
文档与报告
网络
Python自动化部署
深入浅出Ansible
使用Python打造Mysql专家系统
启动简易下载器:python -m SimpleHTTPServer
python -m SimpleHTTPServer
python -m json.tool 格式化json

临时python指令:python -c "print 'aaa'"
pip升级:pip install -U pip
pip常用指令

更改pip的安装源:
vi ~/.pip/pip.conf
[global]
index-url=https://pypi.douban.com/simple/
下载软件到本地安装:
pip install --download='pwd' -r requirements.txt
pip install --no-index -f file://'pwd' -r requirements.txt
PDB调试器

启动pdb调试

ipdb

pep8 一次导入一个模块
代码风格检查

将代码风格编排成PEP8

pyenv进行python版本管理

import sys
sys.argv 所有参数
sys.stdin
fileinput.input()
sys.stdout
sys.stderr
sys.exit(1)
隐藏用户的输入

ConfigParse解析配置文件
命令行参数解析类:argparse ***


click + colorama 简直完美:https://www.cnblogs.com/xiao-apple36/p/9089027.html
prompt_toolkit自动补全

历史提示,自动补全:

历史提示,自动补全,TAB

with open('access.log') as f:
for line in f:
xx
re


re建议编译
search 返回第一次匹配,findall返回所有
获得超链接


string import template

jinja2
os.path路径管理


判断文件类型

查找最常用10条指令

fnmatch 文件

glob整个文件系统查找

os.walk遍历

遍历及查找

shutil文件管理
filecmp文件比较模块
hashlib MD5模块

tarfile

zipfile

shutil加压缩

subprocess

subprocess.check_output

监控dstat\glances
psutil获取CPU个数

获取CPU利用率


psutil.virtual_memory获取内存信息


磁盘:disk_partitions




返回系统启动时间

psutil
psutil