Loading search index…
No recent searches
No results for "Query here"
本章描述的模块支持以持久形式将 Python 数据存储在磁盘上。 pickle和marshal模块可以将许多 Python 数据类型转换为字节流,然后根据字节重新创建对象。各种与 DBM 相关的模块支持一系列基于散列的文件格式,这些文件格式存储字符串到其他字符串的 Map。
本章描述的模块列表为:
pickle — Python 对象序列化
与其他 Python 模块的关系
与 marshal 的比较
与 json 的比较
数据流格式
Module Interface
什么可以腌制和不腌制?
Pickling 类实例
外部对象的持久性
Dispatch Tables
处理有状态对象
自定义类型,函数和其他对象的缩减
Out-of-band Buffers
Provider API
Consumer API
Example
Restricting Globals
Performance
Examples
copyreg —注册 pickle 支持Function
shelve-Python 对象持久性
Restrictions
marshal—内部 Python 对象序列化
dbm — Unix“数据库”的接口
dbm.gnu — GNU 对 dbm 的重新解释
dbm.ndbm —基于 ndbm 的接口
dbm.dumb —便携式 DBM 实现
sqlite3 —用于 SQLite 数据库的 DB-API 2.0 接口
模块Function和常量
Connection Objects
Cursor Objects
Row Objects
Exceptions
SQLite 和 Python 类型
Introduction
让您的对象适应自己
- [Registering an adapter callable](library-sqlite3.html#registering-an-adapter-callable)
将 SQLite 值转换为自定义 Python 类型
默认适配器和转换器
Controlling Transactions
有效使用 sqlite3
使用快捷方式
按名称而不是按索引访问列
将连接用作上下文 Management 器
Common issues
Multithreading