11 2020 档案
摘要:Module Search https://docs.python.org/3/tutorial/modules.html#the-module-search-path 当使用import语句时, 首先解析器会寻找内置的模块, 例如 os, sys 然后在sys.path路径列表中搜索 此列表由如下
阅读全文
摘要:asyncio https://docs.python.org/3.7/library/asyncio.html 异步编程库。 支持并发运行。 提供一些高层API, asyncio is a library to write concurrent code using the async/await
阅读全文
摘要:multiprocessing -- python进程协同 https://docs.python.org/3.7/library/multiprocessing.html multiprocessing is a package that supports spawning processes u
阅读全文
摘要:data persistence https://docs.python.org/3.7/library/persistence.html 支持python内存中的数据以持久化的形式存储在磁盘中。 同时支持从磁盘中将数据恢复到内存中。 The modules described in this ch
阅读全文
摘要:statistics 统计模块支持普通的int float类型,还支持封装的 Decimal 和 Fraction的统计计算。 且输入数据的类型要保持一致。 统计功能分为两个部分: (1)均值和中心位置度量。-- 均值和中位数。 (2)延展度度量。-- 偏差和标准差。 https://docs.py
阅读全文
摘要:deque https://pymotw.com/2/collections/deque.html A double-ended queue, or deque, supports adding and removing elements from either end. The more comm
阅读全文
摘要:Queue for multiple processes 跟线程队列类似。 有三种队列: (1)Queue -- 普通队列 (2)SimpleQueue -- 简化队列,类似管道 (3)JoinableQueue -- 可观测队列。 https://docs.python.org/3.7/libra
阅读全文
摘要:queue https://docs.python.org/3.7/library/queue.html#queue.Queue 支持多生产者和多消费者。 为线程通信设计。 实现三种类型的队列: (1)FIFO (2)LIFO (3)优先队列 还有一个简单队列,是FIFO的一种易用性特例。 The
阅读全文
摘要:xmlrpc 允许软件在不同系统运行。实现计算和存储资源的共享。 http://xmlrpc.com/ It's a spec and a set of implementations that allow software running on disparate operating system
阅读全文
摘要:"Batteries-included" philosophy python版本,含有丰富和多功能的标准库。 不需要用户再去单独下载。 https://www.python.org/dev/peps/pep-0206/#batteries-included-philosophy The Python
阅读全文
摘要:pprint 对于非基本的数据类型, 即对象或者成员中含有对象的数据,print仅仅打印其对象基本信息,在一行中。不会打印数据内容。 如果想打印数据,则需要使用pprint模块。 此模块包括打印接口, 和打印类。 打印类用于定义打印格式, 提供复用。 https://docs.python.org/
阅读全文
摘要:enum 某个变量有若干有表征意义的离散值, 则可以考虑使用枚举。 例如系统运行错误码、HTTP状态码。 https://docs.python.org/3.5/library/enum.html An enumeration is a set of symbolic names (members)
阅读全文
摘要:weakref 赋值运算产生的对象的引用是 强 引用。强引用的存在, 会阻止垃圾回收器回收对象。 在某些场景下, 不希望由于特殊的引用,而不能回收内存。 例如缓存器 和 映射保持器, 这两个可以对大内存对象进行管理。 https://docs.python.org/3.5/library/weakr
阅读全文
摘要:copy https://docs.python.org/3.5/library/copy.html 复制运算并不做对象拷贝动作,仅仅是建立一个连接到原始对象。 如果希望生成一个新的对象,进行修改,不改变原始对象, 则需要拷贝模块。 拷贝模块提供 深浅拷贝功能。 Assignment stateme
阅读全文
摘要:bisect 在有序列表中执行二分查找和插入。 https://docs.python.org/3.5/library/bisect.html This module provides support for maintaining a list in sorted order without ha
阅读全文
摘要:collections.abc -- official 提供了一些抽象基础类,用于判断某个类是否含有某个接口。 抽象基础类有几个最原始的抽象类型: (1)容器 -- Container (2)可哈希 -- Hashable (3)容量 -- Sized (4)可调用 -- Callable (5)可
阅读全文
摘要:collections https://docs.python.org/3.5/library/collections.html 实现一些特殊的容器数据类型。 是对通用内置容器的替代, 例如 词典、列表、集合、元组。 特殊的含义是通用数据类型,在某些常用场景上,不满足,需要手动实现的一些特殊的编程模
阅读全文
摘要:heap https://stackoverflow.com/questions/19979518/what-is-pythons-heapq-module 堆不是二叉树。 堆以list方式存储。 堆不同于sorted list。 堆在插入和删除比sorted list更加高效。 搜索还是sorte
阅读全文