Python 3 Programming cover

Python 3 Programming

Rating 3.2
Word count
110K words
Chapters
279
ISBN
9787115498793

Tags

Summary

The book has 14 chapters. Chapters 1 to 10 cover the fundamentals of Python and encompass the main content of the Python language section of the National Computer Rank Examination; Chapters 11 and 12 cover Python applications, including graphical user interfaces and database programming; Chapters 13 and 14 focus on the use of third-party Python libraries. The textbook is organized around applications, aiming to achieve the broadest possible range of applications with a minimal knowledge set.

Editor's review

Published by Posts & Telecom Press and written by Tang Yonghua, Python 3 Programming (ISBN 9787115498793) is an introductory Python textbook for readers with no prior programming experience. It systematically introduces Python 3's basic syntax, core concepts, and commonly used libraries, covering data types, control flow, functions, object-oriented programming, file operations, exception handling, and advanced topics such as network programming and database access.

As a commonly used textbook for university computer science courses or related programs, the book is characterized by its clear structure and step-by-step progression. Each concept is accompanied by concise sample code and exercises that help readers consolidate what they have learned. Its depth is moderate: it avoids the superficiality of broad but shallow coverage, yet does not get bogged down in the details of complex project development. For beginners seeking to build a solid foundation in Python programming, it offers a steady and reliable learning path.

From an editorial perspective, the book's value lies in its textbook-like rigor and completeness. It does not chase fashionable frameworks or flashy tricks; instead, it focuses on building a solid foundation for programming thinking. For self-learners, it can serve as a systematic learning map; for students, it is excellent supplementary reading for classroom study. The book's brief introduction to algorithm fundamentals and software engineering ideas also prepares readers for further study in areas such as data analysis and web development. Of course, technical books inevitably lag behind the latest versions, so readers should consult the latest official documentation to keep up with minor updates to language features.

Who it's for

A good fit for

  • Lower-year undergraduate students in computer science or related majors seeking a structured course companion textbook.
  • Self-learners with no programming background who want to learn Python systematically from their first line of code.
  • Developers switching languages who need a quick refresher on Python's core syntax and programming concepts.
  • Professionals in non-technical roles who want to improve work efficiency (e.g., office automation) by learning Python.

Not a good fit for

  • Experienced developers seeking to learn the latest advanced Python features (e.g., asynchronous programming, in-depth use of type annotations).
  • Impatient learners who prefer to learn directly through hands-on projects (e.g., machine learning, large-scale web applications).

Reading tips

  1. Study the chapters in order, and be sure to type in and run every sample code to understand its output.
  2. The exercises at the end of each chapter are key to checking your learning; complete them independently even if they seem easy.
  3. Organize core concepts (e.g., list comprehensions, decorators, classes and objects) into your own notes or mind maps.
  4. When studying the later sections on networking, databases, and other topics, consult more specialized materials or official documentation as needed for supplementation.

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. 版权信息
  2. 内容提要
  3. 前言
  4. 第1章 初识Python
  5. 1.1 程序设计语言
  6. 1.1.1 程序设计语言的概念
  7. 1.1.2 编译与解释
  8. 1.2 Python语言
  9. 1.2.1 Python的历史
  10. 1.2.2 Python的特点
  11. 1.2.3 Python的应用
  12. 1.3 Python的开发环境
  13. 1.3.1 下载和安装Python
  14. 1.3.2 内置的IDLE开发环境
  15. 1.3.3 PyCharm集成开发环境
  16. 1.4 Python程序的运行
  17. 1.4.1 Python程序的运行原理
  18. 1.4.2 建立和运行Python程序
  19. 1.5 Python编程方法与应用
  20. 1.5.1 程序设计方法
  21. 1.5.2 程序示例
  22. 1.5.3 Python的帮助文档
  23. 本章小结
  24. 习题1
  25. 第2章 Python基础知识
  26. 2.1 程序的书写规范
  27. 2.1.1 Python的语句
  28. 2.1.2 代码块与缩进
  29. 2.1.3 注释
  30. 2.2 标识符和关键字
  31. 2.2.1 标识符
  32. 2.2.2 关键字
  33. 2.3 Python的数据类型
  34. 2.4 Python的变量
  35. 2.5 Python的运算符
  36. 2.5.1 算术运算符
  37. 2.5.2 比较运算符
  38. 2.5.3 逻辑运算符
  39. 2.5.4 赋值运算符
  40. 2.5.5 位运算符
  41. 2.6 运算符的优先级
  42. 本章小结
  43. 习题2
  44. 第3章 Python中的字符串
  45. 3.1 字符串的表示
  46. 3.2 字符串的格式化
  47. 3.2.1 用%操作符格式化字符串
  48. 3.2.2 format()方法
  49. 3.3 字符串的操作符
  50. 3.4 字符串处理函数
  51. 3.5 输入/输出语句
  52. 3.5.1 输入语句
  53. 3.5.2 输出语句
  54. 本章小结
  55. 习题3
  56. 第4章 Python程序的流程
  57. 4.1 程序设计流程
  58. 4.1.1 程序流程图
  59. 4.1.2 结构化程序设计的基本流程
  60. 4.2 分支结构
  61. 4.3 循环结构
  62. 4.3.1 遍历循环:for语句
  63. 4.3.2 条件循环:while语句
  64. 4.3.3 循环的嵌套
  65. 4.4 流程控制的其他语句
  66. 4.4.1 跳转语句
  67. 4.4.2 pass语句
  68. 4.4.3 循环结构中的else语句
  69. 4.5 流程控制语句的应用
  70. 本章小结
  71. 习题4
  72. 第5章 Python的组合数据类型
  73. 5.1 序列类型
  74. 5.2 列表
  75. 5.2.1 列表的基本操作
  76. 5.2.2 列表的方法
  77. 5.2.3 遍历列表
  78. 5.3 元组
  79. 5.3.1 元组的基本操作
  80. 5.3.2 元组与列表的转换
  81. 5.4 字典
  82. 5.4.1 字典的基本操作
  83. 5.4.2 字典的常用方法
  84. 5.5 集合
  85. 5.5.1 集合的基本操作
  86. 5.5.2 集合运算
  87. 5.6 组合数据类型的应用
  88. 本章小结
  89. 习题5
  90. 第6章 用函数实现代码复用
  91. 6.1 函数的定义和调用
  92. 6.1.1 函数的定义
  93. 6.1.2 函数的调用
  94. 6.1.3 函数的嵌套
  95. 6.2 函数的参数和返回值
  96. 6.2.1 函数的参数
  97. 6.2.2 默认参数
  98. 6.2.3 可变参数
  99. 6.2.4 函数的返回值
  100. 6.2.5 lambda函数
  101. 6.3 闭包和递归函数
  102. 6.3.1 闭包*
  103. 6.3.2 递归函数
  104. 6.4 变量的作用域
  105. 6.4.1 局部变量
  106. 6.4.2 全局变量
  107. 6.4.3 global语句
  108. 6.5 Python的内置函数
  109. 6.5.1 数学运算函数
  110. 6.5.2 字符串运算函数
  111. 6.5.3 转换函数
  112. 6.5.4 序列操作函数
  113. 6.5.5 Python操作相关函数
  114. 本章小结
  115. 习题6
  116. 第7章 用类实现抽象和封装*
  117. 7.1 面向对象编程概述
  118. 7.1.1 面向对象编程的概念
  119. 7.1.2 面向对象编程的特点
  120. 7.2 创建类与对象
  121. 7.2.1 创建类
  122. 7.2.2 创建对象
  123. 7.3 构造方法和析构方法
  124. 7.3.1 构造方法
  125. 7.3.2 析构方法
  126. 7.3.3 self参数
  127. 7.3.4 成员变量和类变量
  128. 7.3.5 类方法和静态方法
  129. 7.4 类的继承
  130. 7.4.1 继承的实现
  131. 7.4.2 方法重写
  132. 7.4.3 Python的多继承
  133. 7.5 类的多态
  134. 7.6 运算符重载
  135. 7.7 面向对象编程的应用
  136. 本章小结
  137. 习题7
  138. 第8章 使用模块和库编程
  139. 8.1 模块
  140. 8.1.1 模块的概念
  141. 8.1.2 导入模块
  142. 8.1.3 执行模块
  143. 8.1.4 模块搜索路径
  144. 8.1.5 __name__属性
  145. 8.2 包
  146. 8.3 Python的标准库
  147. 8.3.1 math库
  148. 8.3.2 random库
  149. 8.3.3 datetime库
  150. 8.4 Python的第三方库
  151. 8.4.1 第三方库简介
  152. 8.4.2 使用pip工具安装第三方库
  153. 8.4.3 Python常用的第三方库
  154. 8.4.4 使用pyinstaller库打包文件
  155. 8.5 turtle库的应用
  156. 8.6 jieba库的应用
  157. 8.6.1 jieba库简介
  158. 8.6.2 jieba库的分词函数
  159. 8.6.3 添加单词和自定义词典
  160. 8.6.4 基于TF-IDF算法的关键词抽取
  161. 8.6.5 中文文本的词频统计
  162. 8.6.6 打包词频统计程序
  163. 本章小结
  164. 习题8
  165. 第9章 Python的文件操作
  166. 9.1 文件的概念
  167. 9.2 文件的打开与关闭
  168. 9.3 文件的读/写操作
  169. 9.3.1 读取文件数据
  170. 9.3.2 向文件写数据
  171. 9.3.3 文件的定位读/写
  172. 9.3.4 读/写二进制文件
  173. 9.4 文件和目录操作
  174. 9.4.1 常用的文件操作函数
  175. 9.4.2 文件的复制、删除及重命名操作
  176. 9.4.3 文件的目录操作
  177. 9.5 使用CSV文件格式读/写数据
  178. 9.5.1 CSV文件介绍
  179. 9.5.2 读/写CSV文件
  180. 9.6 文件操作的应用
  181. 本章小结
  182. 习题9
  183. 第10章 异常处理
  184. 10.1 异常处理概述
  185. 10.1.1 异常的概念
  186. 10.1.2 异常示例
  187. 10.2 Python的异常类
  188. 10.3 异常处理机制
  189. 10.3.1 try…except语句
  190. 10.3.2 else语句和finally语句
  191. 10.3.3 捕获所有的异常
  192. 10.4 抛出异常
  193. 10.4.1 raise语句
  194. 10.4.2 抛出异常示例
  195. 10.5 断言与上下文管理
  196. 10.5.1 断言
  197. 10.5.2 上下文管理
  198. 10.6 自定义异常
  199. 本章小结
  200. 习题10
  201. 第11章 tkinter GUI编程
  202. 11.1 tkinter编程概述
  203. 11.1.1 第一个tkinter GUI程序
  204. 11.1.2 设置窗口和组件的属性
  205. 11.2 tkinter GUI的布局管理
  206. 11.2.1 使用pack()方法的布局
  207. 11.2.2 使用grid()方法的布局
  208. 11.2.3 使用place()方法的布局
  209. 11.2.4 使用框架的复杂布局
  210. 11.3 tkinter的常用组件
  211. 11.3.1 Label组件
  212. 11.3.2 Button组件
  213. 11.3.3 Entry组件
  214. 11.3.4 Listbox组件
  215. 11.3.5 Radiobutton组件
  216. 11.3.6 Checkbutton组件
  217. 11.3.7 Text组件
  218. 11.3.8 Spinbox组件
  219. 11.4 tkinter的事件处理
  220. 11.4.1 使用command参数实现事件处理
  221. 11.4.2 使用组件的bind()方法实现事件处理
  222. 11.5 tkinger GUI的应用
  223. 本章小结
  224. 习题11
  225. 第12章 Python的数据库编程
  226. 12.1 数据库的基础知识
  227. 12.1.1 数据库的概念
  228. 12.1.2 关系型数据库
  229. 12.1.3 Python的SQLite3模块
  230. 12.2 SQLite数据库
  231. 12.2.1 SQLite数据库简介
  232. 12.2.2 下载和安装SQLite数据库
  233. 12.2.3 SQLite3的常用命令
  234. 12.2.4 SQLite3的数据类型
  235. 12.2.5 SQLite3模块中的对象
  236. 12.2.6 SQLite3的函数
  237. 12.2.7 创建SQLite3数据库
  238. 12.3 关系数据库语言SQL
  239. 12.3.1 数据表的建立和删除
  240. 12.3.2 向表中添加列
  241. 12.3.3 向表中插入数据
  242. 12.3.4 修改表中的数据
  243. 12.3.5 删除数据
  244. 12.3.6 查询数据
  245. 12.4 Python的SQLite3编程
  246. 12.4.1 访问数据库的步骤
  247. 12.4.2 创建数据库和表
  248. 12.4.3 数据库的插入、更新和删除操作
  249. 12.5 SQLite编程的应用
  250. 本章小结
  251. 习题12
  252. 第13章 科学计算与图表绘制
  253. 13.1 用于科学计算的numpy库
  254. 13.1.1 numpy简介
  255. 13.1.2 numpy数组的创建
  256. 13.1.3 访问numpy数组的元素
  257. 13.1.4 numpy数组的算术运算
  258. 13.1.5 numpy数组的形状操作
  259. 13.2 用于绘制图表的matplotlib库
  260. 13.2.1 matplotlib简介
  261. 13.2.2 matplotlib.pyplot库中的函数
  262. 13.2.3 绘制直方图、条形图、饼状图
  263. 本章小结
  264. 习题13
  265. 第14章 爬取与分析网页中的数据
  266. 14.1 爬取网页的urllib和requests库
  267. 14.1.1 爬取网页的基础知识
  268. 14.1.2 urllib库
  269. 14.1.3 requests库
  270. 14.2 解析网页的beautifulsoup4库
  271. 14.2.1 beautifulsoup4库概述
  272. 14.2.2 beautifulsoup4库的对象
  273. 14.2.3 beautifulsoup4库操作解析文档树
  274. 14.3 网页爬取技术的应用
  275. 14.3.1 爬取单一网页页面的信息
  276. 14.3.2 爬取来自多个页面的信息
  277. 本章小结
  278. 习题14
  279. 参考文献

FAQ

Is this book suitable for someone with no programming experience at all?
Very suitable. The book starts with setting up the Python environment and the first "Hello, World!" program, assuming no prior programming background, and explains everything in detail, step by step.
Which Python version is the code in this book based on?
The book is written for Python 3. The specific version may depend on when the original book was published, but the core syntax is fully compatible with the current mainstream Python 3.6+ versions. Focus on the core concepts while learning; for minor syntax differences, refer to the latest official documentation.
What level will I reach after finishing this book?
After finishing and mastering the content of this book, you will have solid foundational Python programming skills, be able to understand and use Python to solve small- to medium-scale scripting tasks, be able to read most Python code, and have a solid foundation for learning specific areas such as data analysis and web development.

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.

About the author

唐永华 Author

Tang Yonghua: publicly available information is currently limited, and details of the author's life, nationality, and educational background cannot be confirmed. According to the library's holdings, Tang Yonghua has one work, Python 3 Programming Design, classified under programming design and intended as a book on the Python 3 language and program design. It can therefore be inferred that the author's writing focuses on introductory programming and foundational practice, covering Python 3 syntax, program structure, and design methods, and is aimed mainly at beginners and learners who need a systematic review of the basics. Because more verifiable information is lacking, it is not possible to further describe the author's professional experience, research direction, or academic background. On the available evidence, Tang Yonghua's contribution lies chiefly in this textbook-style work, which helps readers build a basic framework for Python programming through a fairly systematic arrangement and offers a reference learning path among comparable introductory books. More public information would be welcome for a fuller account of the author and the work.

刘德山 Author

Liu Deshan is an author writing in computer-related fields, though publicly available information about him is limited, and details of his life and background cannot be verified. Judging from the four works held in the collection, his writing focuses on two areas: web front-end development and programming. These include HTML5+CSS3 Web Front-End Development Technology and its second edition, as well as Python 3 Programming. He has also addressed software design methods in Java Design Patterns and Application Cases (2nd Edition). Categorized under computer basics, programming design, and examinations, these works cover both practical web page construction and scripting languages, and the application of object-oriented patterns, reflecting an approach that combines foundational introductions with engineering practice. They are suitable as course textbooks or self-study references. Given the lack of biographical material, his writing style and actual influence are difficult to assess in detail.

李玲 Author

Li Ling's publicly available information is limited, yet her writing and editorial work cover a notably broad range. The library holds thirteen of her titles, spanning biography, examination preparation, social culture, medicine, history, and finance. In biography, she has written the three-volume collection Meilanfang Fei as well as the standalone volume Meilanfang Fei: Mei Lanfang in Japan, both centering on the Peking opera master Mei Lanfang's experiences abroad; she is also the author of One Who Refuses to Be a Slave: A Biography of Nie Er, a life of the musician Nie Er. Her practical and instructional works include a cake decorating tutorial, Calculus (Volume One), an experimental guide for materials science, and a pre-service training manual for caregivers. She has also contributed to lighthearted popular history such as Ancient People Knew Better How to Have Fun. Judging from these titles, she handles both historical research and textbooks or popular writing with a practical style aimed at different readerships.

More by the same author

Top rated in the same category