notes
latest
HTML,CSS,JavaScript
book
ci
db
docker
go
java
network
os
python
basis
advance
object oriented
network
modules
模块索引
模块
一些模块
The Python Standard Library
NumPy
PIL
collections
concurrent.futures
contextlib
csv
datetime
docker-py
getpass
hashlib
itertools
json 和 pickle
logging
math
openpyxl
os
pandas
pymssql
PyMysql
queue
random
re
requests模块
shelve
ssl
struct
tablib
threading
time
xlrd & xlwt 处理Excel
xml
scripts
tips
StyleGuide
Python练习
web框架
爬虫
机器学习
Deployment
问题记录
Python相关项目
tmp
安装Python
service
shell
tips
tmp
tools
notes
Docs
»
python
»
modules
Edit on GitHub
modules
¶
模块索引
时间
序列化
进程
模块
使用模块的好处
包
导入模块
动态导入模块
作用域
安装开源模块
内置模块
sys
subprocess 执行系统命令
call
check_call
check_output
subprocess.Popen(…)
shutil
shutil.copyfileobj(fsrc, fdst[, length])
shutil.copyfile(src, dst)
shutil.copymode(src, dst)
shutil.copystat(src, dst)
configparser 配置文件
logging 日志
time & datetime 时间
re 正则
random 随机数
一些模块
Celery
docopt
six
Gunicorn
Pexpect
subprocess
tablib
inspect
click
__future__
Excel
xlrd
xlwt
openpyxl
xlsxwriter
db
pyodbc
爬虫
beautifulsoup4
The Python Standard Library
NumPy
PIL
Pillow
安装
生成字母验证码
问题记录
IOError: cannot open resource
collections
namedtuple
deque
defaultdict
OrderedDict
Counter
collections模块提供了一些有用的集合类,可以根据需要选用。
concurrent.futures
类的方法
Executor Objects
ThreadPoolExecutor
ThreadPoolExecutor Example
ProcessPoolExecutor
ProcessPoolExecutor Example
Future 对象
contextlib
@contextmanager
csv
使用Python生成csv表格,用Excel打开的时候,中文乱码
datetime
获取当前日志和时间
获取指定日志和时间
datetime转换为timestamp
timestamp转换为datetime
str转换为datetime
datetime转换为str
datetime加减
本地时间转换为UTC时间
时区转换
小结
测试
附录 格式代码标准
docker-py
getpass
hashlib
SHA1
sha256,sha512..
摘要算法应用
小结
实例
itertools
count()
cycle()
repeat()
chain()
groupby()
小结
json 和 pickle
json
json.dumps()
json.loads()
json进阶,序列化类
读取json串时保持原有顺序
实例
将字符串序列化成字典
将一个列表类型的变量序列化成字符串类型
小结
pickle
pickle.dump()
pickle.load()
logging
math
math.sqrt()
math.ceil()
openpyxl
读取cell中的颜色
写 excel
append方法
示例
os
常用操作
实例
查看当前目录下所有目录
查看当前目录所有
.gz
结尾的文件
执行命令
pandas
pymssql
先决条件
安装
mac下安装可能会出现如下报错,
__pyx_r
=
DBVERSION_80;
示例
插入数据并查询
查询
游标的注意事项
当处理一个事务的时候
PyMysql
安装
简单测试
queue
队列方法
Queue.qsize()
Queue.empty()
Queue.full()
Queue.put(item, block=True, timeout=None)
Queue.put_nowait(item)
Queue.get(block=True, timeout=None)
Queue.get_nowait()
Queue.task_done()
Queue.join()
实例
其他
random
random.choice()
random.randint()
random.random()
random.randrange()
random.sample()
random.uniform()
random.shuffle()
re
正则表达式概念
字符匹配
次数匹配
边界匹配
正则表达式分组匹配
re模块常用的方法
re.match()
re.search()
re.findall()
re.split()
re.sub()
re.compile()
匹配模式
实例
匹配时不区分大小写
requests模块
安装requests
发送请求与传递参数
response对象
shelve
ssl
struct
请编写一个bmpinfo.py,可以检查任意文件是否是位图文件,如果是,打印出图片大小和颜色数。
tablib
示例
生成单张工作簿, headers 为表头, title 为工作簿名
写 xlsx
threading
time
time.strftime()
time.strptime()
time.gmtime()
xlrd & xlwt 处理Excel
写表格示例
xml
xml.etree.ElementTree
xml.parsers.expat(难用)
Read the Docs
v: latest
Versions
latest
rst
master
Downloads
htmlzip
On Read the Docs
Project Home
Builds
Free document hosting provided by
Read the Docs
.