Python技术手册(第二版,影印版)
Python技术手册(第二版,影印版)
Alex Martelli
出版时间:2006年10月
页数:695
无论对于初学者、专家还是专业人士,《Python技术手册》正是那本他们正在寻觅的关于Python语言习惯用法的优秀参考书。本着“batteries included”的精神,标准库被按照用途组织,并且辅以简单、直观的示例。清晰的写作风格使得阅读本书成为一种乐趣。
— Jeffery D. Collins, Development Lead, 微软公司
当Python程序员在回忆或解释这种开源语言的语法以及它的众多强大但又缺乏文档的模块而需要获得帮助的时候,本书为他们提供了参考。最经常需要的信息在这本全面的参考指南中很容易查找到 —— 不单单关于Python语言本身,还包括标准库中最经常需要使用的部分以及最重要的第三方扩展。
本书经修订和扩充以符合Python 2.5,现在本书包含Python的新subprocess模块的细节,以及微软的新IronPython项目的开创性信息。我们的“Nutshell”形式恰恰与Python相适合,呈现了标准库中最重要的模块和函数的精粹,覆盖了你实际编程所需知识的百分之九十以上。
本书包含以下内容:
Python语言的语法快速指南
Python中面向对象编程的说明
迭代器、生成器、异常、模块、包、字符串以及正则表达式
Python的内置类型、函数和关键模块的快速参考
重要的第三方扩展参考资料,如Numeric和Tkinter
关于扩展和集成Python的信息
《Python技术手册》为程序员最依赖的信息提供了可靠而实际的快速参考。在Python程序员的藏书中本书将迅速占据一席之地。
  1. Preface
  2. Part I. Getting Started with Python
  3. 1. Introduction to Python
  4. The Python Language
  5. The Python Standard Library and Extension Modules
  6. Python Implementations
  7. Python Development and Versions
  8. Python Resources
  9. 2. Installation
  10. Installing Python from Source Code
  11. Installing Python from Binaries
  12. Installing Jython
  13. Installing IronPython
  14. 3. The Python Interpreter
  15. The python Program
  16. Python Development Environments
  17. Running Python Programs
  18. The jython Interpreter
  19. The IronPython Interpreter
  20. Part II. Core Python Language and Built-ins
  21. 4. The Python Language
  22. Lexical Structure
  23. Data Types
  24. Variables and Other References
  25. Expressions and Operators
  26. Numeric Operations
  27. Sequence Operations
  28. Set Operations
  29. Dictionary Operations
  30. The print Statement
  31. Control Flow Statements
  32. Functions
  33. 5. Object-Oriented Python
  34. Classes and Instances
  35. Special Methods
  36. Decorators
  37. Metaclasses
  38. 6. Exceptions
  39. The try Statement
  40. Exception Propagation
  41. The raise Statement
  42. Exception Objects
  43. Custom Exception Classes
  44. Error-Checking Strategies
  45. 7. Modules
  46. Module Objects
  47. Module Loading
  48. Packages
  49. The Distribution Utilities (distutils)
  50. 8. Core Built-ins
  51. Built-in Types
  52. Built-in Functions
  53. The sys Module
  54. The copy Module
  55. The collections Module
  56. The functional Module
  57. The bisect Module
  58. The heapq Module
  59. The UserDict Module
  60. The optparse Module
  61. The itertools Module
  62. 9. Strings and Regular Expressions
  63. Methods of String Objects
  64. The string Module
  65. String Formatting
  66. The pprint Module
  67. The repr Module
  68. Unicode
  69. Regular Expressions and the re Module
  70. Part III. Python Library and Extension Modules
  71. 10. File and Text Operations
  72. Other Chapters That Also Deal with Files
  73. Organization of This Chapter
  74. File Objects
  75. Auxiliary Modules for File I/O
  76. The StringIO and cStringIO Modules
  77. Compressed Files
  78. The os Module
  79. Filesystem Operations
  80. Text Input and Output
  81. Richer-Text I/O
  82. Interactive Command Sessions
  83. Internationalization
  84. 11. Persistence and Databases
  85. Serialization
  86. DBM Modules
  87. Berkeley DB Interfacing
  88. The Python Database API (DBAPI)2.0
  89. 12. Time Operations
  90. The time Module
  91. The datetime Module
  92. The pytz Module
  93. The dateutil Module
  94. The sched Module
  95. The calendar Module
  96. The mx.DateTime Module
  97. 13. Controlling Execution
  98. Dynamic Execution and the exec Statement
  99. Internal Types
  100. Garbage Collection
  101. Termination Functions
  102. Site and User Customization
  103. 14. Threads and Processes
  104. Threads in Python
  105. The thread Module
  106. The Queue Module
  107. The threading Module
  108. Threaded Program Architecture
  109. Process Environment
  110. Running Other Programs
  111. The mmap Module
  112. 15. Numeric Processing
  113. The math and cmath Modules
  114. The operator Module
  115. Random and Pseudorandom Numbers
  116. The decimal Module
  117. The gmpy Module
  118. 16. Array Processing
  119. The array Module
  120. Extensions for Numeric Array Computation
  121. The Numeric Package
  122. Array Objects
  123. Universal Functions (ufuncs)
  124. Auxiliary Numeric Modules
  125. 17. Tkinter GUIs
  126. Tkinter Fundamentals
  127. Widget Fundamentals
  128. Commonly Used Simple Widgets
  129. Container Widgets
  130. Menus
  131. The Text Widget
  132. The Canvas Widget
  133. Layout Management
  134. Tkinter Events
  135. 18. Testing, Debugging, and Optimizing
  136. Testing
  137. Debugging
  138. The warnings Module
  139. Optimization
  140. Part IV. Network and Web Programming
  141. 19. Client-Side Network Protocol Modules
  142. URL Access
  143. Email Protocols
  144. The HTTP and FTP Protocols
  145. Network News
  146. Telnet
  147. Distributed Computing
  148. Other Protocols
  149. 20. Sockets and Server-Side Network Protocol Modules
  150. The socket Module
  151. The SocketServer Module
  152. Event-Driven Socket Programs
  153. 21. CGI Scripting and Alternatives
  154. CGI in Python
  155. Cookies
  156. 22. MIME and Network Encodings
  157. Encoding Binary Data as Text
  158. MIME and Email Format Handling
  159. 23. Structured Text: HTML
  160. The sgmllib Module
  161. The htmllib Module
  162. The HTMLParser Module
  163. The BeautifulSoup Extension
  164. Generating HTML
  165. 24. Structured Text: XML
  166. An Overview of XML Parsing
  167. Parsing XML with SAX
  168. Parsing XML with DOM
  169. Changing and Generating XML
  170. Part V. Extending and Embedding
  171. 25. Extending and Embedding Classic Python
  172. Extending Python with Python ’s C API
  173. Extending Python Without Python ’s C API
  174. Embedding Python
  175. Pyrex
  176. 26. Extending and Embedding Jython
  177. Importing Java Packages in Jython
  178. Embedding Jython in Java
  179. Compiling Python into Java
  180. 27. Distributing Extensions and Programs
  181. Python ’s distutils
  182. py2exe
  183. py2app
  184. cx_Freeze
  185. PyInstaller
  186. Index
书名:Python技术手册(第二版,影印版)
作者:Alex Martelli
国内出版社:东南大学出版社
出版时间:2006年10月
页数:695
书号:7-5641-0576-3
原版书出版商:O'Reilly Media
Alex Martelli
 
Alex Martelli is a member of the Python Software Foundation and works as Uber Tech Lead for Google, Inc. in Mountain View, California.Before joining Google, Alex spent eight years with IBM Research,winning three Outstanding Technical Achievement Awards.He won 13 as Senior Software Consultant at think3 inc, where he developed libraries, network protocols, GUI engines, event frameworks, and web access frontends. He won three more as a freelance consultant, working mostly for AB Strakt,a Python-centered software house in Goteborg, Sweden. Alex has also taught programming languages, development methods, and numerical computing at Ferrara University and other venues. Alex's proudest achievement is the articles that appeared in Bridge World(January/February 2000), which were hailed as giant steps toward solving
issues that had haunted contract-bridge theoreticians for decades.
 
 
The animal on the cover of Python in a Nutshell, Second Edition, is an African
rock python, one of approximately 18 species of python. Pythons are nonven-
omous constrictor snakes that live in tropical regions of Africa, Asia, Australia,
and some Pacific Islands. Pythons live mainly on the ground, but they are also
excellent swimmers and climbers. Both male and female pythons retain vestiges of
their ancestral hind legs. The male python uses these vestiges, or spurs, when
courting a female.
The python kills its prey by suffocation. While the snake’s sharp teeth grip and
hold the prey in place, the python’s long body coils around its victim’s chest,
constricting tighter each time it breathes out. They feed primarily on mammals
and birds. Python attacks on humans are extremely rare.