学习Python(第五版,上下册,影印版)
Mark Lutz
出版时间:2013年12月
页数:1600
“我愿意将《学习Python》最先推荐给那些想要通过Python来学习编程的人。”
——Doug Hellmann,
Racemi公司资深软件工程师

通过这本操作手册,你将获得针对核心Python语言的一次全面而又深入的介绍。基于作者Mark Lutz的畅销培训课程,该第五版修订本将可以帮助你快速使用Python编写高效和高质量的代码。无论你是编程新手还是精通其他语言的有经验的开发人员,这本书都适合于你。
通过小测验、练习和有效的讲解,这本易于遵循、自学的教程可以让你上手Python 2.7和Python 3.3——3.x和2.x产品线上的最新发布版本——以及目前其他常见的版本。你也将学到一些最近在Python代码中越来越常见的高级语言特性。

· 探讨Python主要的内置对象类型,比如数字、列表和字典
· 使用Python语句创建和处理对象并且学习Python的通用语法模型
· 使用函数以避免代码冗余并且重用包代码
· 使用模块来组织语句、函数和其他工具到更大的组件中
· 深入研究类:Python的适合于结构化代码的面向对象编程工具
· 使用Python的异常处理和开发工具来编写大型程序
· 学习高级Python工具,包括修饰符、描述符、元类和Unicode处理

Mark Lutz是世界级的Python培训讲师。他是最早和最畅销Python书籍的作者。从1992年起,他就是Python社区的先锋。Mark拥有30年的软件开发经验,他是O’Reilly出版社的《Python编程》(第四版)和《Python Pocket Reference》(第四版)的作者。
  1. Chapter 1: A Python Q&A Session
  2. Why Do People Use Python?
  3. Is Python a “Scripting Language”?
  4. OK, but What’s the Downside?
  5. Who Uses Python Today?
  6. What Can I Do with Python?
  7. How Is Python Developed and Supported?
  8. What Are Python’s Technical Strengths?
  9. How Does Python Stack Up to Language X?
  10. Chapter Summary
  11. Test Your Knowledge: Quiz
  12. Test Your Knowledge: Answers
  13. Chapter 2: How Python Runs Programs
  14. Introducing the Python Interpreter
  15. Program Execution
  16. Execution Model Variations
  17. Chapter Summary
  18. Test Your Knowledge: Quiz
  19. Test Your Knowledge: Answers
  20. Chapter 3: How You Run Programs
  21. The Interactive Prompt
  22. System Command Lines and Files
  23. Unix-Style Executable Scripts: #!
  24. Clicking File Icons
  25. Module Imports and Reloads
  26. Using exec to Run Module Files
  27. The IDLE User Interface
  28. Other IDEs
  29. Other Launch Options
  30. Which Option Should I Use?
  31. Chapter Summary
  32. Test Your Knowledge: Quiz
  33. Test Your Knowledge: Answers
  34. Test Your Knowledge: Part I Exercises
  35. Types and Operations
  36. Chapter 4: Introducing Python Object Types
  37. The Python Conceptual Hierarchy
  38. Why Use Built-in Types?
  39. Python’s Core Data Types
  40. Numbers
  41. Strings
  42. Lists
  43. Dictionaries
  44. Tuples
  45. Files
  46. Other Core Types
  47. Chapter Summary
  48. Test Your Knowledge: Quiz
  49. Test Your Knowledge: Answers
  50. Chapter 5: Numeric Types
  51. Numeric Type Basics
  52. Numbers in Action
  53. Other Numeric Types
  54. Numeric Extensions
  55. Chapter Summary
  56. Test Your Knowledge: Quiz
  57. Test Your Knowledge: Answers
  58. Chapter 6: The Dynamic Typing Interlude
  59. The Case of the Missing Declaration Statements
  60. Shared References
  61. Dynamic Typing Is Everywhere
  62. Chapter Summary
  63. Test Your Knowledge: Quiz
  64. Test Your Knowledge: Answers
  65. Chapter 7: String Fundamentals
  66. This Chapter’s Scope
  67. String Basics
  68. String Literals
  69. Strings in Action
  70. String Methods
  71. String Formatting Expressions
  72. String Formatting Method Calls
  73. General Type Categories
  74. Chapter Summary
  75. Test Your Knowledge: Quiz
  76. Test Your Knowledge: Answers
  77. Chapter 8: Lists and Dictionaries
  78. Lists
  79. Lists in Action
  80. Dictionaries
  81. Dictionaries in Action
  82. Chapter Summary
  83. Test Your Knowledge: Quiz
  84. Test Your Knowledge: Answers
  85. Chapter 9: Tuples, Files, and Everything Else
  86. Tuples
  87. Files
  88. Core Types Review and Summary
  89. Built-in Type Gotchas
  90. Chapter Summary
  91. Test Your Knowledge: Quiz
  92. Test Your Knowledge: Answers
  93. Test Your Knowledge: Part II Exercises
  94. Statements and Syntax
  95. Chapter 10: Introducing Python Statements
  96. The Python Conceptual Hierarchy Revisited
  97. Python’s Statements
  98. A Tale of Two ifs
  99. A Quick Example: Interactive Loops
  100. Chapter Summary
  101. Test Your Knowledge: Quiz
  102. Test Your Knowledge: Answers
  103. Chapter 11: Assignments, Expressions, and Prints
  104. Assignment Statements
  105. Expression Statements
  106. Print Operations
  107. Chapter Summary
  108. Test Your Knowledge: Quiz
  109. Test Your Knowledge: Answers
  110. Chapter 12: if Tests and Syntax Rules
  111. if Statements
  112. Python Syntax Revisited
  113. Truth Values and Boolean Tests
  114. The if/else Ternary Expression
  115. Chapter Summary
  116. Test Your Knowledge: Quiz
  117. Test Your Knowledge: Answers
  118. Chapter 13: while and for Loops
  119. while Loops
  120. break, continue, pass, and the Loop else
  121. for Loops
  122. Loop Coding Techniques
  123. Chapter Summary
  124. Test Your Knowledge: Quiz
  125. Test Your Knowledge: Answers
  126. Chapter 14: Iterations and Comprehensions
  127. Iterations: A First Look
  128. List Comprehensions: A First Detailed Look
  129. Other Iteration Contexts
  130. New Iterables in Python 3.X
  131. Other Iteration Topics
  132. Chapter Summary
  133. Test Your Knowledge: Quiz
  134. Test Your Knowledge: Answers
  135. Chapter 15: The Documentation Interlude
  136. Python Documentation Sources
  137. Common Coding Gotchas
  138. Chapter Summary
  139. Test Your Knowledge: Quiz
  140. Test Your Knowledge: Answers
  141. Test Your Knowledge: Part III Exercises
  142. Functions and Generators
  143. Chapter 16: Function Basics
  144. Why Use Functions?
  145. Coding Functions
  146. A First Example: Definitions and Calls
  147. A Second Example: Intersecting Sequences
  148. Chapter Summary
  149. Test Your Knowledge: Quiz
  150. Test Your Knowledge: Answers
  151. Chapter 17: Scopes
  152. Python Scope Basics
  153. The global Statement
  154. Scopes and Nested Functions
  155. The nonlocal Statement in 3.X
  156. Why nonlocal? State Retention Options
  157. Chapter Summary
  158. Test Your Knowledge: Quiz
  159. Test Your Knowledge: Answers
  160. Chapter 18: Arguments
  161. Argument-Passing Basics
  162. Special Argument-Matching Modes
  163. The min Wakeup Call!
  164. Generalized Set Functions
  165. Emulating the Python 3.X print Function
  166. Chapter Summary
  167. Test Your Knowledge: Quiz
  168. Test Your Knowledge: Answers
  169. Chapter 19: Advanced Function Topics
  170. Function Design Concepts
  171. Recursive Functions
  172. Function Objects: Attributes and Annotations
  173. Anonymous Functions: lambda
  174. Functional Programming Tools
  175. Chapter Summary
  176. Test Your Knowledge: Quiz
  177. Test Your Knowledge: Answers
  178. Chapter 20: Comprehensions and Generations
  179. List Comprehensions and Functional Tools
  180. Generator Functions and Expressions
  181. Comprehension Syntax Summary
  182. Chapter Summary
  183. Test Your Knowledge: Quiz
  184. Test Your Knowledge: Answers
  185. Chapter 21: The Benchmarking Interlude
  186. Timing Iteration Alternatives
  187. Timing Iterations and Pythons with timeit
  188. Other Benchmarking Topics: pystones
  189. Function Gotchas
  190. Chapter Summary
  191. Test Your Knowledge: Quiz
  192. Test Your Knowledge: Answers
  193. Test Your Knowledge: Part IV Exercises
  194. Modules and Packages
  195. Chapter 22: Modules: The Big Picture
  196. Why Use Modules?
  197. Python Program Architecture
  198. How Imports Work
  199. Byte Code Files: __pycache__ in Python 3.2+
  200. The Module Search Path
  201. Chapter Summary
  202. Test Your Knowledge: Quiz
  203. Test Your Knowledge: Answers
  204. Chapter 23: Module Coding Basics
  205. Module Creation
  206. Module Usage
  207. Module Namespaces
  208. Reloading Modules
  209. Chapter Summary
  210. Test Your Knowledge: Quiz
  211. Test Your Knowledge: Answers
  212. Chapter 24: Module Packages
  213. Package Import Basics
  214. Package Import Example
  215. Why Use Package Imports?
  216. Package Relative Imports
  217. Python 3.3 Namespace Packages
  218. Chapter Summary
  219. Test Your Knowledge: Quiz
  220. Test Your Knowledge: Answers
  221. Chapter 25: Advanced Module Topics
  222. Module Design Concepts
  223. Data Hiding in Modules
  224. Enabling Future Language Features: __future__
  225. Mixed Usage Modes: __name__ and __main__
  226. Example: Dual Mode Code
  227. Changing the Module Search Path
  228. The as Extension for import and from
  229. Example: Modules Are Objects
  230. Importing Modules by Name String
  231. Example: Transitive Module Reloads
  232. Module Gotchas
  233. Chapter Summary
  234. Test Your Knowledge: Quiz
  235. Test Your Knowledge: Answers
  236. Test Your Knowledge: Part V Exercises
  237. Classes and OOP
  238. Chapter 26: OOP: The Big Picture
  239. Why Use Classes?
  240. OOP from 30,000 Feet
  241. Chapter Summary
  242. Test Your Knowledge: Quiz
  243. Test Your Knowledge: Answers
  244. Chapter 27: Class Coding Basics
  245. Classes Generate Multiple Instance Objects
  246. Classes Are Customized by Inheritance
  247. Classes Can Intercept Python Operators
  248. The World’s Simplest Python Class
  249. Chapter Summary
  250. Test Your Knowledge: Quiz
  251. Test Your Knowledge: Answers
  252. Chapter 28: A More Realistic Example
  253. Step 1: Making Instances
  254. Step 2: Adding Behavior Methods
  255. Step 3: Operator Overloading
  256. Step 4: Customizing Behavior by Subclassing
  257. Step 5: Customizing Constructors, Too
  258. Step 6: Using Introspection Tools
  259. Step 7 (Final): Storing Objects in a Database
  260. Future Directions
  261. Chapter Summary
  262. Test Your Knowledge: Quiz
  263. Test Your Knowledge: Answers
  264. Chapter 29: Class Coding Details
  265. The class Statement
  266. Methods
  267. Inheritance
  268. Namespaces: The Conclusion
  269. Documentation Strings Revisited
  270. Classes Versus Modules
  271. Chapter Summary
  272. Test Your Knowledge: Quiz
  273. Test Your Knowledge: Answers
  274. Chapter 30: Operator Overloading
  275. The Basics
  276. Indexing and Slicing: __getitem__ and __setitem__
  277. Index Iteration: __getitem__
  278. Iterable Objects: __iter__ and __next__
  279. Membership: __contains__, __iter__, and __getitem__
  280. Attribute Access: __getattr__ and __setattr__
  281. String Representation: __repr__ and __str__
  282. Right-Side and In-Place Uses: __radd__ and __iadd__
  283. Call Expressions: __call__
  284. Comparisons: __lt__, __gt__, and Others
  285. Boolean Tests: __bool__ and __len__
  286. Object Destruction: __del__
  287. Chapter Summary
  288. Test Your Knowledge: Quiz
  289. Test Your Knowledge: Answers
  290. Chapter 31: Designing with Classes
  291. Python and OOP
  292. OOP and Inheritance: “Is-a” Relationships
  293. OOP and Composition: “Has-a” Relationships
  294. OOP and Delegation: “Wrapper” Proxy Objects
  295. Pseudoprivate Class Attributes
  296. Methods Are Objects: Bound or Unbound
  297. Classes Are Objects: Generic Object Factories
  298. Multiple Inheritance: “Mix-in” Classes
  299. Other Design-Related Topics
  300. Chapter Summary
  301. Test Your Knowledge: Quiz
  302. Test Your Knowledge: Answers
  303. Chapter 32: Advanced Class Topics
  304. Extending Built-in Types
  305. The “New Style” Class Model
  306. New-Style Class Changes
  307. New-Style Class Extensions
  308. Static and Class Methods
  309. Decorators and Metaclasses: Part 1
  310. The super Built-in Function: For Better or Worse?
  311. Class Gotchas
  312. Chapter Summary
  313. Test Your Knowledge: Quiz
  314. Test Your Knowledge: Answers
  315. Test Your Knowledge: Part VI Exercises
  316. Exceptions and Tools
  317. Chapter 33: Exception Basics
  318. Why Use Exceptions?
  319. Exceptions: The Short Story
  320. Chapter Summary
  321. Test Your Knowledge: Quiz
  322. Test Your Knowledge: Answers
  323. Chapter 34: Exception Coding Details
  324. The try/except/else Statement
  325. The try/finally Statement
  326. Unified try/except/finally
  327. The raise Statement
  328. The assert Statement
  329. with/as Context Managers
  330. Chapter Summary
  331. Test Your Knowledge: Quiz
  332. Test Your Knowledge: Answers
  333. Chapter 35: Exception Objects
  334. Exceptions: Back to the Future
  335. Why Exception Hierarchies?
  336. Built-in Exception Classes
  337. Custom Print Displays
  338. Custom Data and Behavior
  339. Chapter Summary
  340. Test Your Knowledge: Quiz
  341. Test Your Knowledge: Answers
  342. Chapter 36: Designing with Exceptions
  343. Nesting Exception Handlers
  344. Exception Idioms
  345. Exception Design Tips and Gotchas
  346. Core Language Summary
  347. Chapter Summary
  348. Test Your Knowledge: Quiz
  349. Test Your Knowledge: Answers
  350. Test Your Knowledge: Part VII Exercises
  351. Advanced Topics
  352. Chapter 37: Unicode and Byte Strings
  353. String Changes in 3.X
  354. String Basics
  355. Coding Basic Strings
  356. Coding Unicode Strings
  357. Using 3.X bytes Objects
  358. Using 3.X/2.6+ bytearray Objects
  359. Using Text and Binary Files
  360. Using Unicode Files
  361. Other String Tool Changes in 3.X
  362. Chapter Summary
  363. Test Your Knowledge: Quiz
  364. Test Your Knowledge: Answers
  365. Chapter 38: Managed Attributes
  366. Why Manage Attributes?
  367. Properties
  368. Descriptors
  369. __getattr__ and __getattribute__
  370. Example: Attribute Validations
  371. Chapter Summary
  372. Test Your Knowledge: Quiz
  373. Chapter 39: Decorators
  374. What’s a Decorator?
  375. The Basics
  376. Coding Function Decorators
  377. Coding Class Decorators
  378. Managing Functions and Classes Directly
  379. Example: “Private” and “Public” Attributes
  380. Example: Validating Function Arguments
  381. Chapter Summary
  382. Test Your Knowledge: Quiz
  383. Test Your Knowledge: Answers
  384. Chapter 40: Metaclasses
  385. To Metaclass or Not to Metaclass
  386. The Metaclass Model
  387. Declaring Metaclasses
  388. Coding Metaclasses
  389. Inheritance and Instance
  390. Metaclass Methods
  391. Example: Adding Methods to Classes
  392. Example: Applying Decorators to Methods
  393. Chapter Summary
  394. Test Your Knowledge: Quiz
  395. Test Your Knowledge: Answers
  396. Chapter 41: All Good Things
  397. The Python Paradox
  398. Where to Go From Here
  399. Encore: Print Your Own Completion Certificate!
  400. Appendixes
  401. Appendix Installation and Configuration
  402. Installing the Python Interpreter
  403. Configuring Python
  404. For More Help
  405. Appendix The Python 3.3 Windows Launcher
  406. The Unix Legacy
  407. The Windows Legacy
  408. Introducing the New Windows Launcher
  409. A Windows Launcher Tutorial
  410. Pitfalls of the New Windows Launcher
  411. Conclusions: A Net Win for Windows
  412. Appendix Python Changes and This Book
  413. Major 2.X/3.X Differences
  414. General Remarks: 3.X Changes
  415. Fifth Edition Python Changes: 2.7, 3.2, 3.3
  416. Fourth Edition Python Changes: 2.6, 3.0, 3.1
  417. Third Edition Python Changes: 2.3, 2.4, 2.5
  418. Earlier and Later Python Changes
  419. Appendix Solutions to End-of-Part Exercises
  420. Part I, Getting Started
  421. Part II, Types and Operations
  422. Part III, Statements and Syntax
  423. Part IV, Functions and Generators
  424. Part V, Modules and Packages
  425. Part VI, Classes and OOP
  426. Part VII, Exceptions and Tools
书名:学习Python(第五版,上下册,影印版)
作者:Mark Lutz
国内出版社:东南大学出版社
出版时间:2013年12月
页数:1600
书号:978-7-5641-4597-2
原版书书名:Learning Python, 5th Edition
原版书出版商:O'Reilly Media
Mark Lutz
 
作为全球Python培训界的领军人物。Mark Lutz是Python最畅销书籍的作者,也是Python社区的先驱。
Mark 是O’Reilly出版的《Programming Python》和《Python Pocket Reference》的作者,这两本书于2009年都已经出版了第3版。Mark自1992年开始接触Python,1995年开始撰写有关Python的书籍,从1997年开始教授Python课程。截止到2009年,他已经开办了225个Python短期培训课程,教授了大约3500名学习者,销售了大约25万册有关Python的书籍。许多书被翻译成十多种语言。
此外,Mark拥有威斯康星大学计算机科学学士和硕士学位,在过去的25年中,他主要从事编译器、编程工具、脚本程序以及各种客户端/服务器系统方面的工作。你也可以通过访问http://www.rmi.net/~lutz与他取得联系。
 
 
"The animal on the cover of Learning Python, Fifth Edition, is a wood rat (Neotoma""Muridae). The wood rat lives in a wide range of conditions (mostly rocky, scrub, and desert areas) over much of North and Central America, generally at some distance from humans. Wood rats are good climbers, nesting in trees or bushes up to six meters off the ground; some species burrow underground or in rock crevices or inhabit other species’ abandoned holes."

"These grayish-beige, medium-size rodents are the original pack rats: they carry anything and everything into their homes, whether or not it’s needed, and are especially attracted to shiny objects such as tin cans, glass, and silverware."

"The cover image is a 19th-century engraving from Cuvier’s Animals. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont’s TheSansMonoCondensed.
购买选项
定价:148.00元
书号:978-7-5641-4597-2
出版社:东南大学出版社