学习Python(第三版,影印版)
学习Python(第三版,影印版)
Mark Lutz
出版时间:2008年08月
页数:700
Python是一种理想的独立程序和脚本程序语言,具有可移植、强大和易用的特点。无论您是初学程序设计还是初学Python,都能通过本书快速而高效地掌握Python核心语言的基础。通读本书,您可以获得足够多的知识,能够学习将Python用于您所选择的任何应用领域。

《学习Python(第三版)》基于作者Mark Lutz在过去10年间讲授培训课程所使用的资料。除了大量的注解插图和每章总结外,作者还为每章加入了独特的一节,通过实际练习和复习提问的方式让您在学习过程中练习新的技能,测验对概念的理解程度。

本书内容包括:

* 类型和运算——深入Python内置对象类型:数值、列表、字典及其他。
* 语句和语法——用来创建和处理对象的Python代码以及Python通用语法模型。
* 函数——Python的基本结构化和代码重用工具。
* 模块——将语句、函数和其他工具组织为更大的组件。
* 类和面向对象编程——可选的Python面向对象程序设计工具,用于定制和重用结构化代码。
* 异常和工具——处理语句和模块异常,并介绍编写较大型程序所使用的开发工具。
* 有关即将发布的Python 3.0的一些讨论。

《学习Python 第三版》为您理解Python语言提供了完整而又深入的介绍,帮助您领会在以后的工作中会遇到的应用级Python实例。如果您准备好探索Google和YouTube究竟从Python中发现了什么,那么本书就是一个最好的开始。

作为Python培训界的领军人物,Mark Lutz是有关Python方面的最早和最畅销书籍的作者,并且从1992年起就是Python社区的先驱之一。同时他还是O’Reilly的《Programming Python》和《Python Pocket Reference》两本书的作者。Mark从1997年开始教授Python课程,截至2007年已经指导了超过200次培训。此外Mark拥有计算机科学学士和硕士学位,以及25年的软件开发经验。
  1. Preface
  2. Part I. Getting Started
  3. 1. A Python Q&A Session
  4. Why Do People Use Python?
  5. Software Quality
  6. Developer Productivity
  7. Is Python a “Scripting Language”?
  8. OK, but What’s the Downside?
  9. Who Uses Python Today?
  10. What Can I Do with Python?
  11. Systems Programming
  12. GUIs
  13. Internet Scripting
  14. Component Integration
  15. Database Programming
  16. Rapid Prototyping
  17. Numeric and Scientific Programming
  18. Gaming, Images, AI, XML, Robots, and More
  19. What Are Python’s Technical Strengths?
  20. It’s Object Oriented
  21. It’s Free
  22. It’s Portable
  23. It’s Powerful
  24. It’s Mixable
  25. It’s Easy to Use
  26. It’s Easy to Learn
  27. It’s Named After Monty Python
  28. How Does Python Stack Up to Language X?
  29. Chapter Summary
  30. Brain Builder
  31. Chapter Quiz
  32. Quiz Answers
  33. 2. How Python Runs Programs
  34. Introducing the Python Interpreter
  35. Program Execution
  36. The Programmer’s View
  37. Python’s View
  38. Byte code compilation
  39. The Python Virtual Machine (PVM)
  40. Performance implications
  41. Development implications
  42. Execution Model Variations
  43. Python Implementation Alternatives
  44. CPython
  45. Jython
  46. IronPython
  47. Execution Optimization Tools
  48. The Psyco just-in-time compiler
  49. The Shedskin C++ translator
  50. Frozen Binaries
  51. Future Possibilities?
  52. Chapter Summary
  53. Brain Builder
  54. Chapter Quiz
  55. Quiz Answers
  56. 3. How You Run Programs
  57. Interactive Coding
  58. Using the Interactive Prompt
  59. System Command Lines and Files
  60. Using Command Lines and Files
  61. Unix Executable Scripts (#!)
  62. Clicking File Icons
  63. Clicking Icons on Windows
  64. The raw_input Trick
  65. Other Icon-Click Limitations
  66. Module Imports and Reloads
  67. The Grander Module Story: Attributes
  68. Modules and namespaces
  69. import and reload Usage Notes
  70. The IDLE User Interface
  71. IDLE Basics
  72. Using IDLE
  73. Advanced IDLE Tools
  74. Other IDEs
  75. Embedding Calls
  76. Frozen Binary Executables
  77. Text Editor Launch Options
  78. Other Launch Options
  79. Future Possibilities?
  80. Which Option Should I Use?
  81. Chapter Summary
  82. Brain Builder
  83. Chapter Quiz
  84. Quiz Answers
  85. Brain Builder: Part I Exercises
  86. Part II. Types and Operations
  87. 4. Introducing Python Object Types
  88. Why Use Built-in Types?
  89. Python’s Core Data Types
  90. Numbers
  91. Strings
  92. Sequence Operations
  93. Immutability
  94. Type-Specific Methods
  95. Getting Help
  96. Other Ways to Code Strings
  97. Pattern Matching
  98. Lists
  99. Sequence Operations
  100. Type-Specific Operations
  101. Bounds Checking
  102. Nesting
  103. List Comprehensions
  104. Dictionaries
  105. Mapping Operations
  106. Nesting Revisited
  107. Sorting Keys: for Loops
  108. Iteration and Optimization
  109. Missing Keys: if Tests
  110. Tuples
  111. Why Tuples?
  112. Files
  113. Other File-Like Tools
  114. Other Core Types
  115. How to Break Your Code’s Flexibility
  116. User-Defined Classes
  117. And Everything Else
  118. Chapter Summary
  119. Brain Builder
  120. Chapter Quiz
  121. Quiz Answers
  122. 5. Numbers
  123. Python Numeric Types
  124. Numeric Literals
  125. Built-in Numeric Tools and Extensions
  126. Python Expression Operators
  127. Mixed Operators Follow Operator Precedence
  128. Parentheses Group Subexpressions
  129. Mixed Types Are Converted Up
  130. Preview: Operator Overloading
  131. Numbers in Action
  132. Variables and Basic Expressions
  133. Numeric Display Formats
  134. Division: Classic, Floor, and True
  135. Bitwise Operations
  136. Long Integers
  137. Complex Numbers
  138. Hexadecimal and Octal Notation
  139. Other Built-in Numeric Tools
  140. Other Numeric Types
  141. Decimal Numbers
  142. Sets
  143. Booleans
  144. Third-Party Extensions
  145. Chapter Summary
  146. Brain Builder
  147. Chapter Quiz
  148. Quiz Answers
  149. 6. The Dynamic Typing Interlude
  150. The Case of the Missing Declaration Statements
  151. Variables, Objects, and References
  152. Types Live with Objects, Not Variables
  153. Objects Are Garbage-Collected
  154. Shared References
  155. Shared References and In-Place Changes
  156. Shared References and Equality
  157. Dynamic Typing Is Everywhere
  158. Chapter Summary
  159. Brain Builder
  160. Chapter Quiz
  161. Quiz Answers
  162. 7. Strings
  163. String Literals
  164. Single- and Double-Quoted Strings Are the Same
  165. Escape Sequences Represent Special Bytes
  166. Raw Strings Suppress Escapes
  167. Triple Quotes Code Multiline Block Strings
  168. Unicode Strings Encode Larger Character Sets
  169. Strings in Action
  170. Basic Operations
  171. Indexing and Slicing
  172. Extended slicing: the third limit
  173. String Conversion Tools
  174. Character code conversions
  175. Changing Strings
  176. String Formatting
  177. Advanced String Formatting
  178. Dictionary-Based String Formatting
  179. String Methods
  180. String Method Examples: Changing Strings
  181. String Method Examples: Parsing Text
  182. Other Common String Methods in Action
  183. The Original string Module
  184. General Type Categories
  185. Types Share Operation Sets by Categories
  186. Mutable Types Can Be Changed In-Place
  187. Chapter Summary
  188. Brain Builder
  189. Chapter Quiz
  190. Quiz Answers
  191. 8. Lists and Dictionaries
  192. Lists
  193. Lists in Action
  194. Basic List Operations
  195. Indexing, Slicing, and Matrixes
  196. Changing Lists In-Place
  197. Index and slice assignments
  198. List method calls
  199. Other common list operations
  200. Dictionaries
  201. Dictionaries in Action
  202. Basic Dictionary Operations
  203. Changing Dictionaries In-Place
  204. More Dictionary Methods
  205. A Languages Table
  206. Dictionary Usage Notes
  207. Using dictionaries to simulate flexible lists
  208. Using dictionaries for sparse data structures
  209. Avoiding missing-key errors
  210. Using dictionaries as “records”
  211. Other ways to make dictionaries
  212. Chapter Summary
  213. Brain Builder
  214. Chapter Quiz
  215. Quiz Answers
  216. 9. Tuples, Files, and Everything Else
  217. Tuples
  218. Tuples in Action
  219. Tuple syntax peculiarities: commas and parentheses
  220. Conversions and immutability
  221. Why Lists and Tuples?
  222. Files
  223. Opening Files
  224. Using Files
  225. Files in Action
  226. Storing and parsing Python objects in files
  227. Storing native Python objects with pickle
  228. Storing and parsing packed binary data in files
  229. Other File Tools
  230. Type Categories Revisited
  231. Object Flexibility
  232. References Versus Copies
  233. Comparisons, Equality, and Truth
  234. The Meaning of True and False in Python
  235. Python’s Type Hierarchies
  236. Other Types in Python
  237. Built-in Type Gotchas
  238. Assignment Creates References, Not Copies
  239. Repetition Adds One Level Deep
  240. Beware of Cyclic Data Structures
  241. Immutable Types Can’t Be Changed In-Place
  242. Chapter Summary
  243. Brain Builder
  244. Chapter Quiz
  245. Quiz Answers
  246. Brain Builder: Part II Exercises
  247. Part III. Statements and Syntax
  248. 10. Introducing Python Statements
  249. Python Program Structure Revisited
  250. Python’s Statements
  251. A Tale of Two ifs
  252. What Python Adds
  253. What Python Removes
  254. Parentheses are optional
  255. End of line is end of statement
  256. End of indentation is end of block
  257. Why Indentation Syntax?
  258. A Few Special Cases
  259. Statement rule special cases
  260. Block rule special case
  261. A Quick Example: Interactive Loops
  262. A Simple Interactive Loop
  263. Doing Math on User Inputs
  264. Handling Errors by Testing Inputs
  265. Handling Errors with try Statements
  266. Nesting Code Three Levels Deep
  267. Chapter Summary
  268. Brain Builder
  269. Chapter Quiz
  270. Quiz Answers
  271. 11. Assignment, Expressions, and print
  272. Assignment Statements
  273. Assignment Statement Forms
  274. Sequence Assignments
  275. Advanced sequence assignment patterns
  276. Multiple-Target Assignments
  277. Multiple-target assignment and shared references
  278. Augmented Assignments
  279. Augmented assignment and shared references
  280. Variable Name Rules
  281. Naming conventions
  282. Names have no type, but objects do
  283. Expression Statements
  284. Expression Statements and In-Place Changes
  285. print Statements
  286. The Python “Hello World” Program
  287. Redirecting the Output Stream
  288. The print >> file Extension
  289. Chapter Summary
  290. Brain Builder
  291. Chapter Quiz
  292. Quiz Answers
  293. 12. if Tests
  294. if Statements
  295. General Format
  296. Basic Examples
  297. Multiway Branching
  298. Python Syntax Rules
  299. Block Delimiters
  300. Statement Delimiters
  301. A Few Special Cases
  302. Truth Tests
  303. The if/else Ternary Expression
  304. Chapter Summary
  305. Brain Builder
  306. Chapter Quiz
  307. Quiz Answers
  308. 13. while and for Loops
  309. while Loops
  310. General Format
  311. Examples
  312. break, continue, pass, and the Loop else
  313. General Loop Format
  314. Examples
  315. pass
  316. continue
  317. break
  318. else
  319. More on the loop else clause
  320. for Loops
  321. General Format
  322. Examples
  323. Basic usage
  324. Other data types
  325. Tuple assignment in for
  326. Nested for loops
  327. Iterators: A First Look
  328. File Iterators
  329. Other Built-in Type Iterators
  330. Other Iteration Contexts
  331. User-Defined Iterators
  332. Loop Coding Techniques
  333. Counter Loops: while and range
  334. Nonexhaustive Traversals: range
  335. Changing Lists: range
  336. Parallel Traversals: zip and map
  337. Dictionary construction with zip
  338. Generating Both Offsets and Items: enumerate
  339. List Comprehensions: A First Look
  340. List Comprehension Basics
  341. Using List Comprehensions on Files
  342. Extended List Comprehension Syntax
  343. Chapter Summary
  344. Brain Builder
  345. Chapter Quiz
  346. Quiz Answers
  347. 14. The Documentation Interlude
  348. Python Documentation Sources
  349. # Comments
  350. The dir Function
  351. Docstrings: _ _doc_ _
  352. User-defined docstrings
  353. Docstring standards
  354. Built-in docstrings
  355. PyDoc: The help Function
  356. PyDoc: HTML Reports
  357. Standard Manual Set
  358. Web Resources
  359. Published Books
  360. Common Coding Gotchas
  361. Chapter Summary
  362. Brain Builder
  363. Chapter Quiz
  364. Quiz Answers
  365. Brain Builder: Part III Exercises
  366. Part IV. Functions
  367. 15. Function Basics
  368. Why Use Functions?
  369. Coding Functions
  370. def Statements
  371. def Executes at Runtime
  372. A First Example: Definitions and Calls
  373. Definition
  374. Calls
  375. Polymorphism in Python
  376. A Second Example: Intersecting Sequences
  377. Definition
  378. Calls
  379. Polymorphism Revisited
  380. Local Variables
  381. Chapter Summary
  382. Brain Builder
  383. Chapter Quiz
  384. Quiz Answers
  385. 16. Scopes and Arguments
  386. Scope Rules
  387. Python Scope Basics
  388. Name Resolution: The LEGB Rule
  389. Scope Example
  390. The Built-in Scope
  391. The global Statement
  392. Minimize Global Variables
  393. Minimize Cross-File Changes
  394. Other Ways to Access Globals
  395. Scopes and Nested Functions
  396. Nested Scope Details
  397. Nested Scope Examples
  398. Factory functions
  399. Retaining enclosing scopes’ state with defaults
  400. Nested scopes and lambdas
  401. Scopes versus defaults with loop variables
  402. Arbitrary scope nesting
  403. Passing Arguments
  404. Arguments and Shared References
  405. Avoiding Mutable Argument Changes
  406. Simulating Output Parameters
  407. Special Argument-Matching Modes
  408. Keyword and Default Examples
  409. Keywords
  410. Defaults
  411. Arbitrary Arguments Examples
  412. Collecting arguments
  413. Unpacking arguments
  414. Combining Keywords and Defaults
  415. The min Wakeup Call
  416. Full credit
  417. Bonus points
  418. The punch line
  419. A More Useful Example: General Set Functions
  420. Argument Matching: The Gritty Details
  421. Chapter Summary
  422. Brain Builder
  423. Chapter Quiz
  424. Quiz Answers
  425. 17. Advanced Function Topics
  426. Anonymous Functions: lambda
  427. lambda Expressions
  428. Why Use lambda?
  429. How (Not) to Obfuscate Your Python Code
  430. Nested lambdas and Scopes
  431. Applying Functions to Arguments
  432. The apply Built-in
  433. Passing keyword arguments
  434. apply-Like Call Syntax
  435. Mapping Functions over Sequences: map
  436. Functional Programming Tools: filter and reduce
  437. List Comprehensions Revisited: Mappings
  438. List Comprehension Basics
  439. Adding Tests and Nested Loops
  440. List Comprehensions and Matrixes
  441. Comprehending List Comprehensions
  442. Iterators Revisited: Generators
  443. Generator Function Example
  444. Extended Generator Function Protocol: send Versus next
  445. Iterators and Built-in Types
  446. Generator Expressions: Iterators Meet List Comprehensions
  447. Timing Iteration Alternatives
  448. Function Design Concepts
  449. Functions Are Objects: Indirect Calls
  450. Function Gotchas
  451. Local Names Are Detected Statically
  452. Defaults and Mutable Objects
  453. Functions Without returns
  454. Enclosing Scope Loop Variables
  455. Chapter Summary
  456. Brain Builder
  457. Chapter Quiz
  458. Quiz Answers
  459. Brain Builder: Part IV Exercises
  460. Part V. Modules
  461. 18. Modules: The Big Picture
  462. Why Use Modules?
  463. Python Program Architecture
  464. How to Structure a Program
  465. Imports and Attributes
  466. Standard Library Modules
  467. How Imports Work
  468. 1. Find It
  469. The module search path
  470. The sys.path list
  471. Module file selection
  472. Advanced module selection concepts
  473. 2. Compile It (Maybe)
  474. 3. Run It
  475. Chapter Summary
  476. Brain Builder
  477. Chapter Quiz
  478. Quiz Answers
  479. 19. Module Coding Basics
  480. Module Creation
  481. Module Usage
  482. The import Statement
  483. The from statement
  484. The from * Statement
  485. Imports Happen Only Once
  486. import and from Are Assignments
  487. Cross-File Name Changes
  488. import and from Equivalence
  489. Potential Pitfalls of the from Statement
  490. When import is required
  491. Module Namespaces
  492. Files Generate Namespaces
  493. Attribute Name Qualification
  494. Imports Versus Scopes
  495. Namespace Nesting
  496. Reloading Modules
  497. reload Basics
  498. reload Example
  499. Chapter Summary
  500. Brain Builder
  501. Chapter Quiz
  502. Quiz Answers
  503. 20. Module Packages
  504. Package Import Basics
  505. Packages and Search Path Settings
  506. Package _ _init_ _.py Files
  507. Package Import Example
  508. from Versus import with Packages
  509. Why Use Package Imports?
  510. A Tale of Three Systems
  511. Chapter Summary
  512. Brain Builder
  513. Chapter Quiz
  514. Quiz Answers
  515. 21. Advanced Module Topics
  516. Data Hiding in Modules
  517. Minimizing from * Damage: _X and _ _all_ _
  518. Enabling Future Language Features
  519. Mixed Usage Modes: _ _name_ _ and _ _main_ _
  520. Unit Tests with _ _name_ _
  521. Changing the Module Search Path
  522. The import as Extension
  523. Relative Import Syntax
  524. Why Relative Imports?
  525. Module Design Concepts
  526. Modules Are Objects: Metaprograms
  527. Module Gotchas
  528. Statement Order Matters in Top-Level Code
  529. Importing Modules by Name String
  530. from Copies Names but Doesn’t Link
  531. from * Can Obscure the Meaning of Variables
  532. reload May Not Impact from Imports
  533. reload, from, and Interactive Testing
  534. reload Isn’t Applied Transitively
  535. Recursive from Imports May Not Work
  536. Chapter Summary
  537. Brain Builder
  538. Chapter Quiz
  539. Quiz Answers
  540. Brain Builder: Part V Exercises
  541. Part VI. Classes and OOP
  542. 22. OOP: The Big Picture
  543. Why Use Classes?
  544. OOP from 30,000 Feet
  545. Attribute Inheritance Search
  546. Classes and Instances
  547. Class Method Calls
  548. Coding Class Trees
  549. OOP Is About Code Reuse
  550. Chapter Summary
  551. Brain Builder
  552. Chapter Quiz
  553. Quiz Answers
  554. 23. Class Coding Basics
  555. Classes Generate Multiple Instance Objects
  556. Class Objects Provide Default Behavior
  557. Instance Objects Are Concrete Items
  558. A First Example
  559. Classes Are Customized by Inheritance
  560. A Second Example
  561. Classes Are Attributes in Modules
  562. Classes Can Intercept Python Operators
  563. A Third Example
  564. Why Use Operator Overloading?
  565. The World’s Simplest Python Class
  566. Chapter Summary
  567. Brain Builder
  568. Chapter Quiz
  569. Quiz Answers
  570. 24. Class Coding Details
  571. The class Statement
  572. General Form
  573. Example
  574. Methods
  575. Example
  576. Calling Superclass Constructors
  577. Other Method Call Possibilities
  578. Inheritance
  579. Attribute Tree Construction
  580. Specializing Inherited Methods
  581. Class Interface Techniques
  582. Abstract Superclasses
  583. Operator Overloading
  584. Common Operator Overloading Methods
  585. _ _getitem_ _ Intercepts Index References
  586. _ _getitem_ _ and _ _iter_ _ Implement Iteration
  587. User-Defined Iterators
  588. Multiple iterators on one object
  589. _ _getattr_ _ and _ _setattr_ _ Catch Attribute References
  590. Emulating Privacy for Instance Attributes
  591. _ _repr_ _ and _ _str_ _ Return String Representations
  592. _ _radd_ _ Handles Right-Side Addition
  593. _ _call_ _ Intercepts Calls
  594. Function Interfaces and Callback-Based Code
  595. _ _del_ _ Is a Destructor
  596. Namespaces: The Whole Story
  597. Simple Names: Global Unless Assigned
  598. Attribute Names: Object Namespaces
  599. The “Zen” of Python Namespaces: Assignments Classify Names
  600. Namespace Dictionaries
  601. Namespace Links
  602. A More Realistic Example
  603. Chapter Summary
  604. Brain Builder
  605. Chapter Quiz
  606. Quiz Answers
  607. 25. Designing with Classes
  608. Python and OOP
  609. Overloading by Call Signatures (or Not)
  610. Classes As Records
  611. OOP and Inheritance: “Is-a” Relationships
  612. OOP and Composition: “Has-a” Relationships
  613. Stream Processors Revisited
  614. OOP and Delegation
  615. Multiple Inheritance
  616. Classes Are Objects: Generic Object Factories
  617. Why Factories?
  618. Methods Are Objects: Bound or Unbound
  619. Documentation Strings Revisited
  620. Classes Versus Modules
  621. Chapter Summary
  622. Brain Builder
  623. Chapter Quiz
  624. Quiz Answers
  625. 26. Advanced Class Topics
  626. Extending Built-in Types
  627. Extending Types by Embedding
  628. Extending Types by Subclassing
  629. Pseudoprivate Class Attributes
  630. Name Mangling Overview
  631. Why Use Pseudoprivate Attributes?
  632. New-Style Classes
  633. Diamond Inheritance Change
  634. Diamond inheritance example
  635. Explicit conflict resolution
  636. Other New-Style Class Extensions
  637. Static and class methods
  638. Instance slots
  639. Class properties
  640. New _ _getattribute_ _ overloading method
  641. Static and Class Methods
  642. Using Static and Class Methods
  643. Function Decorators
  644. Decorator Example
  645. Class Gotchas
  646. Changing Class Attributes Can Have Side Effects
  647. Multiple Inheritance: Order Matters
  648. Methods, Classes, and Nested Scopes
  649. “Overwrapping-itis”
  650. Chapter Summary
  651. Brain Builder
  652. Chapter Quiz
  653. Quiz Answers
  654. Brain Builder: Part VI Exercises
  655. Part VII. Exceptions and Tools
  656. 27. Exception Basics
  657. Why Use Exceptions?
  658. Exception Roles
  659. Exception Handling: The Short Story
  660. The try/except/else Statement
  661. try Statement Clauses
  662. The try/else Clause
  663. Example: Default Behavior
  664. Example: Catching Built-in Exceptions
  665. The try/finally Statement
  666. Example: Coding Termination Actions with try/finally
  667. Unified try/except/finally
  668. Combining finally and except by Nesting
  669. Unified try Example
  670. The raise Statement
  671. Example: Raising and Catching User-Defined Exceptions
  672. Example: Passing Extra Data with raise
  673. Example: Propagating Exceptions with raise
  674. The assert Statement
  675. Example: Trapping Constraints (but Not Errors)
  676. with/as Context Managers
  677. Basic Usage
  678. The Context Management Protocol
  679. Chapter Summary
  680. Brain Builder
  681. Chapter Quiz
  682. Quiz Answers
  683. 28. Exception Objects
  684. String-Based Exceptions
  685. String Exceptions Are Right Out!
  686. Class-Based Exceptions
  687. Class Exception Example
  688. Why Class Exceptions?
  689. Built-in Exception Classes
  690. Specifying Exception Text
  691. Sending Extra Data and Behavior in Instances
  692. Example: Extra data with classes and strings
  693. General raise Statement Forms
  694. Chapter Summary
  695. Brain Builder
  696. Chapter Quiz
  697. Quiz Answers
  698. 29. Designing with Exceptions
  699. Nesting Exception Handlers
  700. Example: Control-Flow Nesting
  701. Example: Syntactic Nesting
  702. Exception Idioms
  703. Exceptions Aren’t Always Errors
  704. Functions Signal Conditions with raise
  705. Debugging with Outer try Statements
  706. Running In-Process Tests
  707. More on sys.exc_info
  708. Exception Design Tips
  709. What Should Be Wrapped
  710. Catching Too Much: Avoid Empty excepts
  711. Catching Too Little: Use Class-Based Categories
  712. Exception Gotchas
  713. String Exceptions Match by Identity, Not by Value
  714. Catching the Wrong Thing
  715. Core Language Summary
  716. The Python Toolset
  717. Development Tools for Larger Projects
  718. Chapter Summary
  719. Brain Builder
  720. Chapter Quiz
  721. Quiz Answers
  722. Brain Builder: Part VII Exercises
  723. Part VIII. Appendixes
  724. A. Installation and Configuration
  725. B. Solutions to End-of-Part Exercises
  726. Index
书名:学习Python(第三版,影印版)
作者:Mark Lutz
国内出版社:东南大学出版社
出版时间:2008年08月
页数:700
书号:978-7-5641-1240-0
原版书出版商: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, Third 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. They 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.