Programming in Python 3: A Complete Introduction to the Python Language (2nd Edition, Revised) cover

Programming in Python 3: A Complete Introduction to the Python Language (2nd Edition, Revised)

No rating yet
Chapters
15
ISBN
9787115383389

Tags

Summary

This is the revised Chinese edition of the second edition of Programming in Python 3 by Mark Summerfield, translated by Wang Hongbo and Sun Chuanqing and published by Posts & Telecom Press. The book begins with the "eight key elements" that make up the Python language—data types, object references, collection data types, logical operators, control flow statements, arithmetic operators, input/output, and creating and calling functions—using one chapter to build a hands-on foundation before going deeper in later chapters. Building on that foundation, the book discusses data type details such as integers, floating-point and decimal numbers, strings, and character encoding; collection data types such as lists, tuples, sets, and dictionaries; control structures, exception handling, and custom functions; modules and packages and an overview of the standard library; custom classes and composite classes in object-oriented programming; and reading, writing, and random access for binary files, text files, and XML files. The second half moves into engineering topics: advanced techniques such as generators, decorators, context managers, descriptors, abstract base classes, metaclasses, and coroutines; debugging, unit testing, and profiling; workload distribution with multiprocessing and multithreading; TCP client and server programming; DBM and SQL database programming; regular expressions; handwritten parsers and parsing with PyParsing and PLY; and writing dialog-style and main-window GUI programs with Tkinter. The book is built around example-driven explanations, with complete examples and end-of-chapter exercises in every chapter; the example code was tested with Python 3 on Windows, Linux, and Mac OS X and can be downloaded with the book. It can be read straight through as a systematic Python 3 tutorial or used as a language reference to fill gaps, and is suited to readers who want to learn Python to a deliverable level.

Editor's review

市面上的 Python 入门书大多停在“能看懂代码”这一层,而这本书的野心是把你带到“能交付程序”的位置。作者 Mark Summerfield 是 Python、C++、Qt 与 PyQt 领域的独立培训专家和顾问,写法带着浓厚的教学痕迹:先在第 1 章提出“Python 的八个关键要素”,把语言的核心骨架一次性交代清楚,接着每一章都从一个可运行的小程序切入,再把背后的机制、边界情况和惯用写法摊开讲。 因此它不只是一本语法书。字符串编码、XML 读写、正则表达式、多进程与多线程、TCP 客户端与服务器、DBM 与 SQL 数据库、GUI 程序设计,这些在实际项目中迟早会撞上的题目都被专门成章;装饰器、上下文管理器、描述符、抽象基类、元类、协程这类“看起来懂了其实没懂”的高级设施,也给了独立的一章和第 8 章的进阶处理。第 9 章讲调试、单元测试与性能剖析,第 14 章讲语法分析,都是同类教材里少见的实用内容。 值得一提的是它作为纸质书的结构优势:章节顺序本身就是一条从语法到工程的学习路径,每章末尾的练习题可以做回路标,随手翻查也足够方便。需要说明的是,本书基于 Python 3 早期版本写成,语言核心部分至今仍然成立,但标准库的若干细节、Tkinter 的写法以及书中采用的第三方库版本已与当下的 Python 3 有距离,配合最新官方文档使用效果最好。

Who it's for

A good fit for

  • 已经会写一点脚本、想系统补齐 Python 3 知识结构的自学者
  • 计算机专业学生,需要一本覆盖语法到工程的课程参考书
  • 从 Python 2 或其他语言转过来,想弄清 Python 惯用写法的开发者
  • 需要做数据处理、文本分析、GUI 小工具或网络程序的全栈/运维人员

Not a good fit for

  • 完全没有编程经验、期待卡通图与零基础讲解的读者
  • 只想学数据分析库(如 NumPy、Pandas)或 Web 框架(如 Django)的读者
  • 希望直接照着做完整项目案例、以项目驱动学习的人

Reading tips

  1. 按章节顺序读第 1—7 章,把示例代码亲手敲一遍,这七章是全书地基。
  2. 第 8—15 章按需选读:要做工具就重点看文件处理与 GUI,要做服务端就看网络与数据库。
  3. 每章末尾的练习不要跳过,它们通常比正文更能暴露理解上的漏洞。
  4. 书中的标准库与 Tkinter 细节以当前 Python 官方文档为准,遇到行为不一致时先查版本差异。

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. Chapter 1 A Quick Introduction to Procedural Programming
  2. Chapter 2 Data Types
  3. Chapter 3 Collection Data Types
  4. Chapter 4 Control Structures and Functions
  5. Chapter 5 Modules
  6. Chapter 6 Object-Oriented Programming
  7. Chapter 7 File Handling
  8. Chapter 8 Advanced Programming Techniques
  9. Chapter 9 Debugging, Testing, and Profiling
  10. Chapter 10 Processes and Threads
  11. Chapter 11 Networking
  12. Chapter 12 Database Programming
  13. Chapter 13 Regular Expressions
  14. Chapter 14 Introduction to Parsing
  15. Chapter 15 Introduction to GUI Programming

FAQ

这本书与《Python 3程序开发指南》初版有什么区别?
初版于 2011 年出版,ISBN 9787115245076,豆瓣评分约 6.7;2015 年的第 2 版修订版 ISBN 9787115383389,共 518 页,定价 69 元,在章节编排、示例代码与部分技术细节上做了修订,是目前更常见的版本。
书中的 Python 3 内容现在还能用吗?
语言核心(数据类型、函数、类、生成器、装饰器、协程等)基本仍然适用;但标准库若干接口、Tkinter 写法以及书中使用的部分第三方库版本已发生变化,建议对照当前官方文档阅读,代码报错时先核对版本。
零基础能不能直接读这本书?
可以读,但不轻松。第 1 章虽然从“创建并运行程序”讲起,节奏却偏快,默认读者有其他语言的编程经验。零基础读者建议先做完一本入门小书,再回来把它当作系统化提升。
每章的示例代码在哪里获取?
示例代码由作者在其个人站点(qtrac.eu)提供下载,书中注明这些代码已在 Windows、Linux、Mac OS X 上用 Python 3 测试。若链接失效,可尝试在代码托管平台搜索该书英文名 Programming in Python 3 的配套仓库。
这本书适合当教材用吗?
比较适合。全书按 15 章循序渐进,每章有小结与练习题,覆盖从语法到调试、并发、网络、数据库的综合主题,出版信息中也将读者定位为 Python 初学者与程序设计人员,适合作为一门一学期的 Python 课程参考书。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

More by the same author

Top rated in the same category