Skip to Content
Python 技術手冊 第三版
book

Python 技術手冊 第三版

by lex Martelli, Anna Martelli Ravenscroft, Steve Holden
January 2018
Intermediate to advanced content levelIntermediate to advanced
856 pages
17h 17m
Chinese
GoTop Information, Inc.
Content preview from Python 技術手冊 第三版
381
11
續存和資料庫
Python 支援數種保存資料(persisting data)的方式。其中一種方式,
序列化
serialization
,會將資料視為 Python 物件所成的一個群集(a
collection of Python objects)。這些物件可以被
序列化
serialized
,儲
存)為一個位元組資料流(byte stream),並在之後從這個位元組資料流
解序列化
deserialized
,載入並重新建立)回資料。
物件續存
object
persistence
則奠基於序列化之上,新增像是物件命名(object naming)的
功能。本章涵蓋支援序列化與物件續存的 Python 模組。
讓資料續存的另一種方式是將它儲存在一個資料庫(databaseDB)中,
有一種簡單的 DB 是使用
透過鍵值的存取
keyed access
來選擇性讀取或
更新資料特定部分的檔案格式(file formats)。本章涵蓋支援數個這種檔案
格式的 Python 標準程式庫模組,叫做
DBM
關聯式
DB
管理系統
relational DB management system
RDBMS),
PostgreSQL Oracle,提供一種更為強大的方式來儲存、搜尋和取
回(retrieving)續存的資料。關聯式 DB 仰賴
Structured Query Language
SQL)的方言來建立或變更一個 DB 的綱要(schema)、插入或更新 DB
中的資料,以及根據搜尋條件 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

測試驅動開發|使用 Python

測試驅動開發|使用 Python

Harry J.W. Percival
Linux 内核观测技术BPF

Linux 内核观测技术BPF

David Calavera, Lorenzo Fontana

Publisher Resources

ISBN: 9789864766819