Learn Python with Lao Qi: From Beginner to Mastery cover

Learn Python with Lao Qi: From Beginner to Mastery

Rating 3.5
Word count
640 words
Chapters
13
Series
Learn Python with Lao Qi
ISBN
9787121280344

Tags

Summary

Learn Python with Lao Qi: From Beginner to Mastery is a Python tutorial by Qi Wei (online name "Lao Qi") for readers with no programming background. The author's earlier online series, Learn Python from Scratch, had already built up a following, and this book was compiled on that basis. The book is organized as three progressive seasons—Basics, Advanced, and Hands-On. It begins with Python's history, features, and installation and setup, getting an environment ready on Ubuntu, Windows, and OS X and writing the first Hello World. It then systematically explains basic object types such as numbers and the four arithmetic operations, division and rounding, strings, lists, tuples, dictionaries, and sets, along with statement-level topics including conditionals, for and while loops, file reading and writing, and iteration. Next come advanced topics: functions, classes and object-oriented programming (inheritance, polymorphism, encapsulation, special methods, iterators, and generators), error and exception handling, modules and the standard library, and third-party libraries. The final part turns to data storage and practical applications, covering pickle, shelve, MySQL, MongoDB, SQLite, and spreadsheet operations, and closes with building a website with Tornado and doing scientific computing with Pandas. Emphasizing "teach a man to fish," the author goes beyond syntax rules and weaves in methodological content on programmer growth—reading code, debugging programs, and self-reflective learning. The writing is colloquial and rich in analogies, so it does not read as dryly as a traditional textbook. At roughly 400 pages and 640,000 characters, it suits as the first Python book for self-taught beginners.

Editor's review

市面上的Python入门书多,但大多出自外文翻译或培训机构讲义,这本《跟老齐学Python:从入门到精通》难得地保留了中文作者讲课式的口吻——老齐不是把语法条目一条条列给你看,而是一边演示一边解释“为什么要这样写”。全书分“基础—进阶—实战”三季推进:前四季从装环境、写Hello World起步,把数字、字符串、列表、字典、集合这些基本对象类型讲透,再讲流程控制与文件操作;中段进入函数、面向对象、异常、模块和标准库;最后用Tornado做一个能登录、连数据库的小网站,并借助Pandas处理股票数据,让读者真正摸到“能跑起来的项目”。 对零基础读者最友好的一点,是书中反复示范“怎么读代码、怎么调试、怎么自己查文档”,这也是作者所说的“授人以渔”:语法是会过时的,但查证与自省的能力不会。当然,本书初版于2016年,示例基于Python 2.x时代的环境和raw_input、urllib2等旧接口,Tornado与Pandas部分也明显早于现在的版本,读者照敲代码时难免遇到需要自行迁移的地方——把它当作打基础的教材,把代码当作练习题,配合官方文档学习会更顺。整体而言,它是一本身段温和、够厚够全的中文入门书,适合从零开始又不想被术语吓退的人。

Who it's for

A good fit for

  • 完全没写过代码、想从零开始学Python的成年人自学
  • 上过一点编程课但基础不牢、需要系统梳理语法与数据结构的在校学生
  • 习惯看中文讲解、希望有人“边讲边敲”的转行学习者
  • 需要一本覆盖面向对象、模块与数据库的基础教材做课后配套的培训班学员

Not a good fit for

  • 已有扎实Python基础、想找进阶技巧或工程实践手册的开发者
  • 需要使用Python 3最新语法与第三方库最新版本的读者(本书示例偏旧)
  • 希望直接做机器学习、爬虫或Web后端项目实战、不愿从头学语法的人

Reading tips

  1. 建议边读边敲,每章的示例代码都亲手运行一遍,尤其把书中的练习题当作检验标准。
  2. 遇到涉及Python 2时代的写法(如raw_input、urllib2),先去官方文档查对应Python 3的用法,再做迁移。
  3. 按“基础—进阶—实战”的顺序阅读,不必一次读完;第一季扎实后再进入面向对象部分。
  4. 读完后用Tornado小网站与Pandas示例做一次完整复现,作为检验学习效果的项目。

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

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. Season 1 Basics
  2. Chapter 0 Preliminaries: 0.1 The Story of Python (Python's past, present, and future; Python's features; the Zen of Python); 0.2 From Handyman to Expert (starting from zero; reading code; debugging programs); 0.3 Installing Python (Ubuntu, Windows, Mac OS X); 0.4 Integrated Development Environments (IDEs) (Hello world; overview of IDEs; Python IDEs)
  3. Chapter 1 Basic Object Types: 1.1 Numbers (variables; simple arithmetic; integer overflow); 1.2 Division (integer by integer; float by integer; using modules to solve division; remainders; rounding); 1.3 Common Math Functions and Operator Precedence; 1.4 A First Simple Program; 1.5 Strings (concatenation; escape characters; raw strings; input and output; indexing and slicing; common methods; formatted output); 1.6 Character Encoding (encode and decode; garbled Chinese text); 1.7 Lists; 1.8 Comparison
  4. Chapter 2 Statements and Files: 2.1 Operators (arithmetic, comparison, logical); 2.2 Simple Statements (print, import, assignment); 2.3 Conditionals (if, if…elif…else, ternary operator); 2.4 for Loops (range, zip, enumerate, list comprehensions); 2.5 while Loops (guess-the-number game, break and continue, while…else, for…else); 2.6 Files (opening, creating, with, file status, r)
  5. Chapter 3 Functions: 3.1 Understanding Functions (defining, naming, calling, return values, docstrings); 3.2 Terms Distinguished (parameters and variables, global and local variables, namespaces); 3.3 Collecting Parameters; 3.4 Special Functions (recursion, etc.); 3.5 Exercises (solving a quadratic equation, tallying exam scores, finding primes)
  6. Season 2 Advanced
  7. Chapter 4 Classes: 4.1 Basic Concepts; 4.2 Classes in Detail (new-style and old-style classes, methods and instances, self); 4.3 Class and Instance Attributes, Namespaces, Scope; 4.4 Inheritance (multiple inheritance, super); 4.5 Methods (bound, unbound, static and class methods); 4.6 Polymorphism and Encapsulation; 4.7 Special Attributes and Methods (__dict__, __slots__, __getattr__, etc.); 4.8 Iterators; 4.9 Generators (yield, generator methods)
  8. Chapter 5 Errors and Exceptions: errors, exceptions, handling exceptions (try…except, multiple exceptions, else, finally, assert)
  9. Chapter 6 Modules: writing modules (module location, __all__, packages and libraries); batteries included; the standard library (sys, copy, os, heapq, deque, calendar, time, datetime, urllib, XML, JSON); third-party libraries (installation and a requests example)
  10. Chapter 7 Saving Data: pickle, shelve, MySQL, MongoDB, SQLite, spreadsheets
  11. Season 3 Hands-On
  12. Chapter 8 Building a Website with Tornado: preparing to build a site, analyzing Hello, building a simple site (database connection, login page, data transmission and handling, templates, CSS, cookies and security, XSRF, user authentication, synchronous and asynchronous)
  13. Chapter 9 Scientific Computing: preparing to compute, Pandas (basic data structures, reading CSV files, processing stock data)

FAQ

这本书适合完全没有编程基础的人吗?
适合。作者明确表示本书是面向零基础读者的入门读物,不是开发手册,开篇即从Python的来历、版本选择、在Windows/macOS/Linux上安装环境讲起,再逐步进入变量、字符串、列表等内容,行文偏口语化。
这本书讲的是Python 2还是Python 3?
书中大量示例沿用Python 2时代的语法和库,如raw_input、urllib2、整除与浮点除法的讨论等,同时部分内容也提及Python 3。学习时建议以Python 3环境运行,遇到不兼容处按官方文档迁移。
“从入门到精通”真的能到精通吗?
更准确地说,它是从零到能写出较完整程序的中级入门书:覆盖函数、面向对象、异常、标准库、数据库读写,并以Tornado做网站、Pandas处理数据作示范。真正的“精通”仍需项目实践与更深入的专题阅读。
书名同为《跟老齐学Python》,怎么区分版本?
作者在电子工业出版社出版过多个“跟老齐学Python”系列:2016年3月的《从入门到精通》(ISBN 9787121280344,约400页),以及2017年3月的《轻松入门》(ISBN 9787121306624,332页),另有《Django实战》《数据分析》等专题册,购买时注意核对副标题和ISBN。

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

Qi Wei is an author about whom little public information is available; no systematic account of his identity or career has yet appeared. His two works in the library nonetheless indicate his main writing interests. He focuses on artificial intelligence and programming design, and is the author of Data Preparation and Feature Engineering: Essential Skills for Data Engineers and Mathematical Foundations of Machine Learning. The first addresses practical aspects of data engineering, including data cleaning, organization, and feature construction; the second returns to the mathematical principles behind machine learning, helping readers build a theoretical foundation. Together, the two books show a style that values both fundamentals and hands-on practice, with clear and accessible language suitable for beginners and advanced readers alike.

More by the same author

Top rated in the same category