Python: Complete Case-Based Learning and Practice
Tags
Summary
Editor's review
The book's core value lies in its "all-case-driven" approach. Professor Shen Hongwei abandons the dry syntax-to-syntax listing of traditional textbooks in favor of more than 200 practical cases that progress from simple to advanced. These cases are not a mere pile of code snippets but carefully designed, interconnected "building blocks." Readers grasp core concepts such as variables, loops, functions, and object orientation almost without noticing as they assemble the blocks. This "learning by doing" approach greatly reduces beginners' cognitive load and turns abstract programming thinking into tangible practical results.
Another hallmark of the book is its systematic content and engineering-practice orientation. It covers not only essential knowledge such as Python basic syntax, data structures, and file operations but also extends to popular application areas such as web scraping, data analysis, and graphical interfaces. Particularly noteworthy is the dedicated "Engineering Practice" section, which guides learners to modularize scattered knowledge into projects and cultivates the comprehensive ability to solve real problems. This progression from "knowledge points" to "knowledge surfaces" to a "knowledge body" reflects the author's deep understanding of learning patterns as a front-line educator.
Professor Shen Hongwei's teaching background gives the book a distinctive "tutorial feel." The language is plain and friendly, like an experienced mentor guiding you step by step at your side, and it anticipates and answers beginners' common mistakes and mental stumbling blocks with precision. Although the book may not go as deep as purely advanced monographs, it strikes an excellent balance between "introduction" and "getting hands-on," building learners a solid and extensible cognitive framework. For readers eager to truly master Python through practice and to establish correct programming thinking, this book is a reliable map.
Who it's for
A good fit for
- Absolute beginners in programming who want a painless entry path
- Non-computer professionals who need to apply Python to scenarios such as data analysis and office automation
- Students in computer-related majors at colleges and universities seeking a practical guide complementary to their courses
- Developers with some background in other languages who want to switch quickly to Python and learn about its typical applications
Not a good fit for
- Senior programmers seeking in-depth explanations of Python's underlying mechanisms, advanced features, or source code analysis
- Readers who want a concise tool manual for quickly looking up APIs or syntax details
Reading tips
- It is recommended to proceed strictly in chapter order, because the cases build on and relate to one another
- Hands-on practice is key; be sure to type out and run every case code in your own environment
- After each chapter, try making small modifications to or combinations of the cases to test your understanding
About the publisher
The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.
Contents
- 版权信息
- 内容简介
- 前言
- 第1篇 营造环境
- 第1章 Python及其安装
- 1.1 为什么要学习Python
- 1.1.1 Python的广泛性
- 1.1.2 Python的新颖性
- 1.1.3 Python的生态性
- 1.1.4 Python的应用领域举例
- 1.1.5 Python的局限性
- 1.2 学习Python的必备“神器”
- 1.2.1 Python概况
- 1.2.2 常用的Python集成开发环境
- 1.3 安装和设置Python
- 1.3.1 获取Python
- 1.3.2 安装Python
- 1.3.3 设置Python
- 思考与实践
- 第2章 IDLE的使用
- 2.1 IDLE的安装与设置
- 2.1.1 IDLE的安装
- 2.1.2 IDLE的启动
- 2.1.3 IDLE的个性化设置
- 2.2 Edit编辑模式与Shell命令行模式的切换
- 2.2.1 Edit编辑模式与Shell命令行模式的切换方式
- 2.2.2 IDLE的文本编辑功能
- 2.3 在IDLE中运行程序
- 2.3.1 在Edit模式下运行程序
- 2.3.2 在Shell模式下运行程序
- 2.4 IDLE的程序调试功能
- 2.4.1 两种调试方法
- 2.4.2 在Shell模式下的程序调试
- 2.4.3 在Edit模式下的程序调试
- 2.4.4 断点调试
- 2.5 在Shell模式下如何清屏
- 思考与实践
- 第3章 安装PyCharm
- 3.1 PyCharm及其安装
- 3.1.1 PyCharm的3种版本形式
- 3.1.2 获取PyCharm
- 3.1.3 安装PyCharm
- 3.2 PyCharm的个性化设置
- 3.2.1 设置入口
- 3.2.2 外观设置
- 3.2.3 Editor与自动代码补齐设置
- 3.2.4 解释器设置
- 3.2.5 运行键设置
- 思考与实践
- 第4章 Python的标准资源
- 4.1 Python内置的标准模块
- 4.1.1 通过help()命令查看内置模块
- 4.1.2 通过IDLE的【Help】菜单查看内置模块
- 4.1.3 常用内置模块及其功能介绍
- 4.1.4 内置模块的主要函数(方法)简介
- 4.2 内置模块的应用举例
- 4.2.1 与路径相关的应用举例
- 4.2.2 与时间相关的应用举例
- 4.3 Python的内置函数
- 4.3.1 如何查看Python有哪些内置函数
- 4.3.2 内置函数及其功能
- 4.3.3 内置函数的应用举例
- 思考与实践
- 第5章 Python的外部资源
- 5.1 为什么要安装外部模块
- 5.2 如何安装外部模块
- 5.2.1 升级安装工具
- 5.2.2 使用pip安装外部模块
- 5.2.3 使用easy_install安装外部模块
- 5.3 将安装后的外部模块导入PyCharm中
- 5.4 通过PyCharm安装外部模块
- 5.4.1 通过Project Interpreter方式安装外部模块
- 5.4.2 通过Plugins方式安装外部模块
- 5.5 常用的外部模块及其应用
- 5.5.1 常用的外部模块
- 5.5.2 外部模块的应用举例
- 思考与实践
- 第2篇 掀起盖头
- 第6章 我的Python处女作
- 6.1 新建工程
- 6.1.1 新建工程文件
- 6.1.2 新建Python文件
- 6.1.3 配置工程并运行
- 6.2 关于工程及其要注意的3个事项
- 6.2.1 关于首次运行程序的注意事项
- 6.2.2 关于工程的必要设置
- 6.2.3 关于运行与调试功能的设置问题
- 6.2.4 关于3种运行方式
- 思考与实践
- 第7章 Python的数据类型
- 7.1 Python程序的基本组成
- 7.1.1 一个温度转换的例子
- 7.1.2 程序的注释
- 7.1.3 语句
- 7.1.4 常量
- 7.1.5 变量
- 7.1.6 标识符
- 7.1.7 函数
- 7.2 Python的数据类型及其有关特性
- 7.2.1 Python的数据类型分类
- 7.2.2 Python变量的基本特性
- 7.3 Python中的常量
- 7.3.1 数字
- 7.3.2 字符串
- 7.3.3 布尔值
- 7.3.4 空值
- 7.4 Python中的基本类型变量
- 7.4.1 变量的使用
- 7.4.2 基本变量的赋值
- 7.4.3 变量的地址
- 7.5 Python中的构造类型变量
- 7.5.1 字符串
- 7.5.2 列表
- 7.5.3 元组
- 7.5.4 集合
- 7.5.5 字典
- 7.6 归纳与总结
- 7.6.1 各种类型的相互转换
- 7.6.2 字符串、列表、元组、字典和集合的异同点
- 思考与实践
- 第8章 Python的数据运算
- 8.1 运算符的分类
- 8.2 运算符的功能与特点
- 8.2.1 算术运算符
- 8.2.2 比较运算符
- 8.2.3 赋值运算符
- 8.2.4 逻辑运算符
- 8.2.5 成员运算符
- 8.2.6 身份运算符
- 8.2.7 位运算符
- 8.3 运算符的优先级
- 8.3.1 优先级与结合性
- 8.3.2 优先级的使用举例
- 思考与实践
- 第9章 键盘输入与屏幕输出
- 9.1 键盘输入与input()函数
- 9.1.1 input()函数的功能
- 9.1.2 数据类型之间的转换
- 9.2 屏幕输出与print()函数
- 9.2.1 print()函数的功能
- 9.2.2 print()函数的3种使用形式
- 9.3 练一练:通用倒计时器
- 9.3.1 程序设计要求与具体程序
- 9.3.2 程序的两种运行方式
- 9.4 归纳与总结
- 思考与实践
- 第10章 学会选择靠if语句
- 10.1 选择问题与if语句
- 10.2 if语句的3种语法形式
- 10.2.1 if语句的第一种语法形式
- 10.2.2 if语句的第二种语法形式
- 10.2.3 if语句的第三种语法形式
- 10.3 多重if语句与if语句的嵌套
- 10.4 关于if语句的重要小结
- 10.5 练一练——正整数分离
- 思考与实践
- 第11章 重复操作与循环语句
- 11.1 循环及其应用
- 11.2 while和for语句
- 11.2.1 while语句
- 11.2.2 for语句
- 11.3 break和continue语句
- 11.4 练一练——摄氏与华氏温度转换
- 11.4.1 程序设计要求与具体程序
- 11.4.2 程序的详细分析
- 11.5 归纳与总结
- 11.5.1 循环语句for与while的else扩展
- 11.5.2 break与continue语句的区别
- 思考与实践
- 第12章 函数让程序优雅
- 12.1 什么是函数
- 12.1.1 函数的概念
- 12.1.2 为什么要使用函数
- 12.2 函数的定义与调用
- 12.2.1 如何定义一个函数
- 12.2.2 如何调用函数
- 12.3 函数的参数传递与不定长参数
- 12.3.1 不可变类型参数的传递与可变类型参数的传递
- 12.3.2 必须参数、默认参数与关键词参数
- 12.3.3 不定长参数
- 12.4 匿名函数
- 12.5 变量的作用范围
- 12.6 练一练——“剪刀、石头、布”游戏
- 12.6.1 程序设计要求与算法设计
- 12.6.2 完整程序与运行结果
- 12.7 归纳与总结
- 12.7.1 函数的意义
- 12.7.2 return语句
- 12.7.3 关于默认参数
- 12.7.4 if__name__=='__main__'的作用
- 思考与实践
- 第13章 “分而治之”与程序的模块化
- 13.1 模块化及其意义
- 13.1.1 为什么要模块化
- 13.1.2 什么是模块
- 13.2 如何定义和使用模块
- 13.2.1 中模块——文件模块的定义与应用
- 13.2.2 模块是如何被找到并引用的——模块搜索路径
- 13.3 大模块——包的定义与应用
- 13.3.1 什么是“包”
- 13.3.2 如何定义包
- 13.3.3 包的使用
- 13.4 归纳与总结
- 思考与实践
- 第14章 文件与数据格式化
- 14.1 文件及其操作
- 14.1.1 文件概述
- 14.1.2 打开文件——open()函数
- 14.1.3 打开文件举例
- 14.1.4 读文件
- 14.1.5 写文件
- 14.1.6 文件指针及其移动
- 14.1.7 关闭文件
- 14.2 文件的应用举例——词频统计
- 14.2.1 英文文献的词频统计
- 14.2.2 jieba模块与中文文献的词频统计
- 14.3 CSV格式文件与JSON格式文件的操作
- 14.3.1 CSV格式文件及其操作
- 14.3.2 JSON格式文件及其操作
- 14.4 归纳与总结
- 14.4.1 关于文件的几点注意事项
- 14.4.2 文件的迭代
- 思考与实践
- 第15章 面向对象与类——让程序更人性化
- 15.1 面向对象与类
- 15.1.1 面向过程的程序设计
- 15.1.2 面向对象的程序设计
- 15.1.3 类
- 15.2 类的定义
- 15.2.1 类的定义与__init__()方法
- 15.2.2 实例方法、类方法和静态方法
- 15.2.3 实例变量与类变量
- 15.2.4 私有属性和私有方法
- 15.3 类的使用
- 15.3.1 不带默认属性的类及其使用
- 15.3.2 带默认属性的类及其使用
- 15.3.3 类的组合使用
- 15.4 类的封装性
- 15.4.1 什么是封装
- 15.4.2 如何封装
- 15.5 类的继承性
- 15.5.1 什么是继承
- 15.5.2 类的单继承
- 15.5.3 构造函数的继承
- 15.5.4 类的多继承
- 15.5.5 类的多级继承
- 15.5.6 类的混合继承
- 15.6 类的多态性
- 15.6.1 什么是多态性
- 15.6.2 多态性举例
- 15.7 从模块中导入类
- 15.8 归纳与总结
- 15.8.1 类方法的属性化
- 15.8.2 关于内置变量__mro__
- 15.8.3 关于内置函数issubclass()与isinstance()
- 15.8.4 关于内置函数dir()
- 思考与实践
- 第16章 异常处理让程序健壮
- 16.1 错误与异常
- 16.1.1 错误(Error)
- 16.1.2 异常(Exception)
- 16.1.3 常见的标准异常
- 16.1.4 自定义异常
- 16.1.5 为什么要进行异常处理
- 16.2 异常处理的一般方法——try语句
- 16.2.1 try语句的一般语法
- 16.2.2 try语句的执行过程分析
- 16.3 异常处理的特殊方法——with语句
- 16.3.1 上下文管理
- 16.3.2 为什么要使用with语句
- 16.3.3 with语句的一般形式
- 16.3.4 with语句的工作机制
- 16.3.5 自定义上下文管理器
- 16.3.6 以Socket通信举例说明上下文管理器的定义
- 16.4 归纳与总结
- 16.4.1 关于try语句
- 16.4.2 关于异常的其他问题
- 16.4.3 关于Socket通信的再说明
- 思考与实践
- 第3篇 实战演习
- 第17章 桌面小游戏——剪刀、石头、布
- 17.1 图形化人机界面GUI及其应用
- 17.2 基于GUI的“剪刀、石头、布”游戏的算法与类的设计
- 17.2.1 算法设计
- 17.2.2 类的设计
- 17.2.3 计算机出拳的实现
- 17.2.4 最高得分的保存与读取
- 17.2.5 图形化界面
- 17.2.6 按键和鼠标的捕捉与处理
- 17.3 编辑程序
- 17.3.1 新建PyCharm工程
- 17.3.2 完整的源程序
- 17.3.3 程序运行效果
- 17.4 归纳与总结
- 17.4 .1 设置解释器时出现“Cannot Save Settings”错误及其解决办法
- 17.4.2 将代码生成可执行文件
- 思考与实践
- 第18章 数据挖掘与分析——Bilibili视频爬虫
- 18.1 数据挖掘与网络爬虫
- 18.1.1 数据挖掘
- 18.1.2 网络爬虫
- 18.1.3 网络爬虫的工作原理
- 18.1.4 实现网络爬虫的关键技术
- 18.1.5 爬虫的基本框架
- 18.1.6 反爬虫与Robots协议
- 18.2 Python网络爬虫的开发平台与环境
- 18.3 爬虫的案例—B站网络爬虫
- 18.3.1 功能与设计要求
- 18.3.2 目标URL和应用接口的获取
- 18.3.3 举例:如何快速找到B站全站视频信息的公共接口(API)
- 18.3.4 算法与流程图
- 18.3.5 多进程与多线程的选择
- 18.3.6 完整的程序代码
- 18.4 归纳与总结
- 18.4.1 关于requests中get()方法的几点注意事项
- 18.4.2 爬虫尺寸
- 18.4.3 反爬虫技术
- 思考与实践
- 第19章 图像识别与机器学习——字符型验证码自动识别
- 19.1 机器视觉与机器学习
- 19.1.1 机器视觉
- 19.1.2 机器学习
- 19.1.3 机器学习与神经网络
- 19.2 TensorFlow及其卷积神经网络
- 19.2.1 TensorFlow及其介绍
- 19.2.2 TensorFlow的程序举例
- 19.2.3 基于TensorFlow的卷积神经网络
- 19.3 字符型验证码的自动识别
- 19.3.1 字符型验证码
- 19.3.2 自动识别字符型验证码的两种方法
- 19.4 字符型验证码自动识别程序的实现
- 19.4.1 字符型验证码自动识别程序的算法设计
- 19.4.2 字符型验证码自动识别程序架构
- 19.4.3 字符型验证码自动识别程序
- 19.4.4 程序运行结果及其分析
- 19.5 归纳与总结
- 19.5.1 关于CNN模型
- 19.5.2 关于TensorFlow的一些问题
- 19.5.3 关于深度学习框架的问题
- 思考与实践
- 第20章 智能控制——基于串口控制的二极管花样显示
- 20.1 项目的设计目标
- 20.1.1 项目设计要求
- 20.1.2 串口及其设置
- 20.2 Pyboard开发板及其应用
- 20.2.1 Pyboard开发板
- 20.2.2 Pyboard开发板的安装
- 20.2.3 Pyboard开发板的控制方式
- 20.2.4 Pyboard开发板与上位机的串口通信测试
- 20.3 发光二极管显示板
- 20.4 项目的算法及其分析
- 20.4.1 上位机程序的算法
- 20.4.2 下位机程序的算法
- 20.5 项目的程序
- 20.5.1 上位机程序
- 20.5.2 下位机程序
- 20.6 实际运行效果及其分析
- 20.6.1 样机及其运行演示
- 20.6.2 程序运行要点
- 20.6.3 Pyboard开发板的资源
- 20.7 归纳与总结
- 思考与实践
- 第4篇 继续前进
- 第21章 程序的调试、测试与断言
- 21.1 程序的调试与测试
- 21.1.1 程序调试的方法
- 21.1.2 使用Python内置单步调试器(Pdb)调试程序
- 21.1.3 利用IDE集成开发环境调试程序
- 21.2 程序测试的方法
- 21.2.1 为什么要对程序进行测试
- 21.2.2 通过unittest实现一般测试
- 21.2.3 使用TestSuite进行测试
- 21.3 归纳与总结
- 思考与实践
- 第22章 Python程序的打包与发布
- 22.1 为什么要将程序打包
- 22.2 如何将程序打包
- 22.2.1 打包成.pyc文件
- 22.2.2 Python程序的运行过程
- 22.2.3 打包成.exe文件
- 22.3 归纳与总结
- 思考与实践
- 第23章 Python那些不得不说的事情
- 23.1 如何使程序更Pythonic
- 23.1.1 Python程序的基本原则
- 23.1.2 交换变量值(Swap Values)
- 23.1.3 合并字符串
- 23.1.4 使用关键字in
- 23.1.5 Python的True值(Truth Value)
- 23.1.6 enumerate—索引和元素(Index&Item)
- 23.1.7 Python方法中参数的默认值
- 23.2 迭代器
- 23.2.1 迭代器及其应用
- 23.2.2 列表生成式
- 23.3 生成器
- 23.3.1 生成器及其应用
- 23.3.2 yield及其使用
- 23.4 归纳与总结
- 思考与实践
- 后记
- 致谢
- 参考文献
FAQ
Is this book suitable for people with no programming experience at all?
Are the cases in the book outdated or disconnected from real applications?
What level can I reach after finishing the book?
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
Shen Hongwei: publicly available information is limited. What can be confirmed is that the author writes mainly on programming and design topics, with one work held in the collection, Python Full-Case Learning and Practice. As the title and its category suggest, the book is aimed at learners of Python programming and adopts a case-driven approach, weaving knowledge points into concrete practical tasks and emphasizing hands-on exercises and the development of programming thinking. Rather than merely listing syntax, this style of writing typically uses runnable examples to help readers understand language features and ways to solve common problems, making it suitable for beginners learning Python step by step and useful for those with some foundation who wish to fill gaps. Based on the available information, the author's educational background, professional experience and other works cannot be confirmed, but the book offers practical reference value in programming instruction and self-study, reflecting a writing orientation that values practice and case-based learning.