Python: Learn and Use It cover

Python: Learn and Use It

No rating yet
Word count
398 words
Chapters
40
Series
Information Science and Technology Series
ISBN
9787111539896

Tags

Summary

Python: Learn and Use It is edited by Zhang Yanni, with Ding Weicai (Chapter 10) and Zhang Xiufeng (Chapter 6) as contributing authors. It was published by China Machine Press in October 2016 as part of the Information Science and Technology Series. The main text runs to about 255 pages and roughly 398,000 characters, in 16-mo paperback format. The book is organized in a two-tier structure of "fundamentals + advanced topics": each chapter first explains the basic syntax and core concepts of Python, then immediately follows with an advanced application topic on the same theme, so that readers can put what they have learned to work on real problems as soon as they finish a chapter. The fundamentals cover the introduction and development environment (IDLE, PyCharm, Spyder, pip and easy_install, Anaconda), data types (numbers, strings, lists, tuples, dictionaries), control flow, functions and functional programming (decorators, lambda, map/filter/reduce, closures, generators), file and file-system operations, modules and packages, object orientation (classes, instances, inheritance, polymorphism, abstract base classes), database access (DB-API 2.0, Psycopg 2, MySQL, ORM), network programming (CGI, WSGI), regular expressions, and GUI programming (Tkinter). The advanced topics extend to Matplotlib plotting (including an example that draws historical candlestick charts), scientific computing with NumPy and SciPy, reading and writing Excel files with xlwt/xlrd/xlutils, packaging and distributing programs with Distutils and py2exe, the Flask micro web framework (SQLAlchemy, WTF, Jinja2), page parsing with Beautiful Soup, PyQt event programming, and common big-data tools such as JSON, XML, HDF5/PyTables, and pandas. The code in the book is provided in both Python 2 and Python 3 versions and can be downloaded free of charge.

Editor's review

大多数 Python 入门书会把“语法”和“能干活”分成两本书,这本《Python即学即用》把两者压进了同一章:前一节讲清语法,后面紧跟一个“高级话题”,用真实的小案例把刚学的知识用起来。例如讲完数字类型就接 NumPy,讲完文件操作就接 Excel 读写,讲完数据库就接 ORM,讲完网络编程就接 Flask,讲完正则就接 Beautiful Soup,讲完 GUI 就接 PyQt 和 ToDo 实例,最后一章直接用 JSON、XML、HDF5 与 pandas 处理数据。 全书对读者友好的一面在于“工具选型务实”:开发环境统一在 Anaconda 下,包管理讲 pip 与 easy_install,代码同时给出 Python 2 与 Python 3 两套版本,方便对照旧代码。第 8、9 章共用同一张 todo 表的数据模型,从数据库读到 Flask 写成网页,逻辑连贯,很适合当课程设计或项目练手的骨架。 需要提醒的是,本书成书于 2016 年,示例中的库版本(如 PyQt、Flask、xlwt)与 Python 2 相关内容已经偏旧,动手时按当前官方文档调整即可。它的价值更多在于“知识—应用”的对应结构,而非现成可抄的代码。

Who it's for

A good fit for

  • 有基础语法概念、想把 Python 用到数据分析与 Web 项目中的初学者
  • 需要一门课带学生完成“语法+应用”闭环的高校教师与在校学生
  • 做数据处理、报表与 Excel 自动化,希望了解 NumPy、pandas、PyTables 的工程人员
  • 有 Java、C 等语言经验,想通过对照案例快速上手 Python 的程序员

Not a good fit for

  • 完全零基础、需要大量练习与项目引导的纯新手,本书节奏偏快
  • 追求最新 Python 3.11+ 特性与最新库版本的读者,书中示例较旧
  • 寻找机器学习、深度学习算法原理的读者,本书不涉及模型与算法推导

Reading tips

  1. 按章顺序读,每章先吃透基础小节,再动手跑一遍对应的高级话题代码,形成“学一段用一段”的节奏。
  2. 先装好 Anaconda 环境,把书中 Python 2 与 Python 3 两套示例代码下载下来跑通,再逐章改写为自己熟悉的版本。
  3. 遇到 PyQt、Flask、xlwt 等库报错时,先查当前官方文档确认 API 变化,把“改代码”本身当作练习。
  4. 建议同步建立一个自己的小项目(如 todo 数据表),从数据库写到 Flask 网页,把第 8、9 章串成一条完整链路。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Publisher's Note
  2. Preface
  3. Chapter 1 Introduction
  4. 1.1 Features of Python
  5. 1.2 Python Versions and Integrated Packages
  6. 1.3 Downloading and Installing Python (Windows Installation, Anaconda)
  7. 1.4 Python IDEs (IDLE, PyCharm, Spyder, Other IDEs)
  8. 1.5 How to Install Software Packages (easy_install, pip)
  9. 1.6 Advanced Topic: Matplotlib (Plotting, Drawing Historical Stock Candlestick Charts)
  10. Chapter 2 Data Types
  11. 2.1 Numeric Data Types (bool, int, long integer, float, Decimal, complex numbers, operators)
  12. 2.2 Sequences (strings, lists, tuples)
  13. 2.3 Dictionaries (creation, access, related functions)
  14. 2.4 Advanced Topic: NumPy (differences between arrays and lists, data types)
  15. Chapter 3 Control Flow and Operations
  16. 3.1 Selection Structures (single branch, double branch, multiple branches, conditional expressions)
  17. 3.2 Loop Structures (while, for)
  18. 3.3 Advanced Topic: NumPy Array Operations (creation, indexing and slicing, transposition, universal functions, statistics, set operations, random numbers, sorting, linear algebra, file access)
  19. Chapter 4 Functions and Functional Programming
  20. 4.1 Functions
  21. 4.2 Function Parameters
  22. 4.3 Decorators
  23. 4.4 Functional Programming (lambda, map/filter/reduce, partial functions)
  24. 4.5 Variable Scope (global statement, closures)
  25. 4.6 Recursion
  26. 4.7 Generators
  27. 4.8 Advanced Topic: SciPy (Fourier transform, filtering)
  28. Chapter 5 Files
  29. 5.1 Disk Files
  30. 5.2 StringIO File-like Objects
  31. 5.3 File System Operations (os module, os.path module, shutil module)
  32. 5.4 Advanced Topic: Reading and Writing Excel Files in Python (xlwt, xlrd, xlutils)
  33. Chapter 6 Modules and Packages
  34. 6.1 Modules (search path, import, namespaces, circular imports)
  35. 6.2 Packages
  36. 6.3 Advanced Topic: Program Packaging (Distutils, py2exe)
  37. Chapter 7 Classes
  38. 7.1 Basic Concepts
  39. 7.2 Class Definition
  40. 7.3 Instances (creation, initialization, special methods)

FAQ

这本书的书名是不是《从0到1 Python即学即用》?
不是同一本书。《Python即学即用》由张燕妮主编,机械工业出版社 2016 年出版,ISBN 9787111539896;而《从0到1 Python即学即用》作者是莫振杰,人民邮电出版社出版,属另一本面向零基础的入门书,购买与查资料时请按作者和 ISBN 区分。
书里的代码用的是 Python 2 还是 Python 3?
两者都兼顾。书中示例代码分别提供 Python 2 与 Python 3 两个版本供免费下载,正文也专门用附录 C 讨论“Python 2 还是 Python 3”的取舍问题,读者可按自己环境选择对应版本。
零基础能直接读吗?
可以读,但不轻松。本书第一章从环境安装讲起,语法部分讲解较为紧凑,且每章后半段立刻进入 NumPy、Flask 等应用话题。完全没有编程经验的话,建议先配合一本更循序渐进的入门书打底,再回来使用本书练应用。
书中示例现在还能跑通吗?
部分需要调整。本书出版于 2016 年,涉及 PyQt、Flask、xlwt、pandas 等的示例使用的是当年的版本与接口,当前版本可能有变化甚至弃用(如 Python 2 已停止维护),运行报错时应以官方最新文档为准进行修改。
这本书适合当高校教材吗?
比较适合。全书结构规整,每章“基础+高级话题+小结”便于安排课时,第 8、9 章共用同一 todo 数据模型也便于设计课程实践。出版社在内容提要中明确写明可用于高等院校计算机教学,教师可按章节拆分安排实验。

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

Zhang Yanni is an author about whom limited public information is available. The records currently show only two works, one in programming and design and the other in cultural writing, covering quite different fields. The first, Cloud Data Lake: Building Robust Cloud Data Architecture, addresses readers interested in cloud computing and data engineering, discussing how to build stable and reliable data lake architectures in the cloud; it is a technical work with a practical orientation. The second, I Believe in China, turns to cultural themes and focuses on expressions and reflections concerning China. The wide gap between these two subjects suggests that Zhang's writing is not confined to a single direction: she is willing to engage with both technically demanding content and cultural topics. Since details such as dates of birth and death, nationality, and educational background are not recorded, her life cannot be described in detail, and readers may begin with these two works to understand her writing interests and emphases in different fields.

More by the same author

Top rated in the same category