Python Crash Course: A Hands-On, Project-Based Introduction to Programming (2nd Edition) cover

Python Crash Course: A Hands-On, Project-Based Introduction to Programming (2nd Edition)

Rating 4.7
Word count
396K words
Chapters
28
Series
Turing Programming Series
ISBN
9787115546081

Tags

Summary

This is an introductory Python tutorial for readers at all levels. The original is Eric Matthes's Python Crash Course, 2nd Edition; the Chinese edition was translated by Yuan Guozhong. The book has two parts. Part I, "Basics," uses 11 chapters to introduce the concepts every Python programmer must master, step by step: from setting up a programming environment and writing your first Hello World program, to variables and simple data types, lists and working with lists, if statements, dictionaries, user input and while loops, functions, classes, files and exceptions, and finally testing your code, helping readers write clean, readable, and reliable code. Part II, "Projects," puts knowledge into practice through three complete projects. Project 1, "Alien Invasion," spans three chapters—arming the ship, aliens are coming, and scoring—to build a 2D shooting game. Project 2, "Data Visualization," spans three chapters—generating data, downloading data, and working with APIs—using libraries such as Matplotlib and Plotly to create interactive infographics. Project 3, "Web Applications," spans three chapters—getting started with Django, user accounts, and styling and deploying an application—to build and launch a simple web app. The second edition is fully revised: the Python installation process is simplified, f-strings, the get() method, large-number notation, and constant notation are added, and the projects use Plotly along with new versions of Django and Bootstrap. The book ends with appendices on installation and troubleshooting, text editors and IDEs, getting help, and version control with Git, plus accompanying source code, exercise answers, and learning videos.

Editor's review

这本被称为“蟒蛇书”的Python入门经典,长期位居Amazon编程入门类榜首,中文版豆瓣评分稳定在9分以上,是很多人第一次学编程时唯一读完的技术书。它最大的优点是“不跳步”:安装环境、变量、列表、字典、函数、类、文件操作,每个概念都配一遍代码、一个练习题,语言平实,几乎不堆术语,读者不会读到一半就卡住。真正让它区别于普通入门书的是第二部分三个项目——2D游戏“外星人入侵”、数据可视化、Django Web应用。读者会发现自己能用学到的语法做出看得见、玩得起来的东西,成就感推着人往下走。第2版针对新的Python版本做了全面修订:安装流程更简单,新增f字符串、get()方法等内容,项目改用Plotly以及新版本的Django和Bootstrap,代码跑起来更顺利。随书配有全部源代码、练习题答案和配套学习视频,自学时有地方对照检查。特别提醒:与第3版相比,第2版的编辑器仍以Sublime Text为主要示例,若已习惯VS Code,可对照第3版使用。

Who it's for

A good fit for

  • 完全没有编程基础、想系统学一门语言的成年人
  • 在校学生,尤其是需要完成Python课程作业或课程设计的人
  • 想转行数据分析、Web开发,需要一份能跑通项目的入门材料
  • 自学编程时容易半途而废、需要跟着完整项目做完的读者

Not a good fit for

  • 已有多年Python经验、想深入语言底层或性能优化的开发者
  • 只想要一本速查手册、不想按章节跟着练习的人
  • 需要Python 3.12以上新特性与VS Code工作流的读者,建议直接看第3版

Reading tips

  1. 第1—11章务必逐章敲代码并完成课后练习,不要只读不写,这部分是全书地基。
  2. 三个项目至少完整做一个,推荐从“外星人入侵”开始,成功运行后再挑战数据可视化和Django项目。
  3. 遇到语法变化或报错,先查阅随书代码和官方文档,再用附录A、附录C的排错与求助方法定位问题。
  4. 全书一般需要6—10周,建议每周固定3—5次、每次1—2小时的节奏,保持连续比一次看很多更有效。

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. Part I Basics
  2. Chapter 1 Getting Started
  3. Chapter 2 Variables and Simple Data Types
  4. Chapter 3 Introducing Lists
  5. Chapter 4 Working with Lists
  6. Chapter 5 if Statements
  7. Chapter 6 Dictionaries
  8. Chapter 7 User Input and while Loops
  9. Chapter 8 Functions
  10. Chapter 9 Classes
  11. Chapter 10 Files and Exceptions
  12. Chapter 11 Testing Your Code
  13. Part II Projects
  14. Project 1 Alien Invasion: Chapter 12 A Ship That Fires Bullets
  15. Chapter 13 Aliens!
  16. Chapter 14 Scoring
  17. Project 2 Data Visualization: Chapter 15 Generating Data
  18. Chapter 16 Downloading Data
  19. Chapter 17 Working with APIs
  20. Project 3 Web Applications: Chapter 18 Getting Started with Django
  21. Chapter 19 User Accounts
  22. Chapter 20 Styling and Deploying an App
  23. Appendix A Installation and Troubleshooting
  24. Appendix B Text Editors and IDEs
  25. Appendix C Getting Help
  26. Appendix D Using Git for Version Control
  27. Afterword
  28. About the Author

FAQ

这本书零基础能看懂吗?
可以。全书按“搭环境—基础语法—小练习—完整项目”的顺序编排,语言通俗,几乎不提前引入难懂术语,作者本人长期教授Python入门课程。只要愿意动手敲代码,零基础也能跟上。
第2版和第3版有什么区别?
第3版在原书第3版基础上全面修订,改用VS Code作为编辑器,新增removeprefix()、removesuffix()方法,并在项目中使用Matplotlib和Plotly的最新特性。第2版内容同样完整,若使用较新的Python版本,建议选第3版。
书里的代码和练习答案在哪里获取?
图灵社区本书页面提供随书下载资源,包括全书源代码、练习答案、安装说明和配套学习视频链接;也可以在社区页面下载作者整理的阅读计划。
这本书要配Python什么版本?
第2版以Python 3.6及以上版本为基准编写,使用f字符串、get()方法等内容。建议安装当前主流的Python 3.x版本,但需注意部分库(如Django、Plotly)更新后用法可能有变化,必要时查阅官方文档。
学完之后能到什么水平?
能掌握Python基础语法、函数与类、文件与异常处理、单元测试,并独立完成一个2D小游戏、一组数据可视化图表和一个带用户账户的Django网站,达到可以继续深入某个方向(数据分析、Web开发等)的入门水平。

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