python相关的代码片段 大部分可在python3.6运行,少数代码需要在python3.7+运行。
执行命令: python -c 'import this'
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
9、字符的编码解码,编码类型检测(encoding、chardet)
24、比较两种生产者与消费者模型(threading与asyncio)
25、多进程实现生产者消费者模型(multiprocessing)
26、多进程共享内存的应用(Process和Manager)
20、搜索算法:利用Trie实现多模字符串的匹配(类AC自动机)
23、搜索算法:Dijkstra最短路径算法的另一种python实现
27、搜索算法:利用mmh3+bitarray实现BloomFilter
28、数据结构:DoubleArrayTrie双数组前缀树的python实现
4、matplotlib的更多应用(曲线图、直方图、散点图、3D图)