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

Python 技術手冊 第三版

by lex Martelli, Anna Martelli Ravenscroft, Steve Holden
January 2018
Intermediate to advanced
856 pages
17h 17m
Chinese
GoTop Information, Inc.
Content preview from Python 技術手冊 第三版
311
10
檔案與文字作業
本章涵蓋 Python 中處理檔案與檔案系統有關的多數議題。一個
檔案
file
是程式可以讀取或寫入的文字或位元組資料流(stream);一個
案系統
filesystem
是電腦系統上由檔案構成的一個階層架構式的存放庫
a hierarchical repository of files)。
也涉及檔案的其他章節
因為檔案是程式設計中非常重要的概念,雖然本章是本書中最長的一章,
但還有其他幾章也含有處理特定種類檔案時相關的參考資料。特別是,
11 章涵蓋與續存(persistence)和資料庫(database)功能性有關的許
多種檔案(「json 模組」中的 JSON,「 pickle cPickle 模組」中的 pickle
,「 shelve 模組」中的 shelve ,「 v3 dbm 套件」中的DBM
DBM 檔案,以及「SQLite」中的 SQLite 資料庫檔案),第 22 章處理
HTML 格式的檔案和其他資料流,而第 23 章涵蓋 XML 格式的檔案和其他
資料流。
本章的組織方式
檔案與資料流有許多種類:它們的內容可以是任意的位元組或文字(如
果底層的儲存區或管道只處理位元組,就像大多數的那樣,就會有各種
編碼);它們可能適合用於讀取、寫入或兩者皆可;它們可能是
有緩衝的
312
|
10 章 檔案與文字作業
buffered
;它們可能允許「隨機存取(random access)」,可在檔案中前
後移動(舉例來說,底層管道是 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

利用 Python 进行数据分析(原书第2版)

利用 Python 进行数据分析(原书第2版)

Wes McKinney

Publisher Resources

ISBN: 9789864766819