This book offers Python programmers one place to look when they need help remembering or deciphering the syntax of this open source language and its many powerful but scantily documented modules. This comprehensive reference guide makes it easy to look up the most frequently needed information--not just about the Python language itself, but also the most frequently used parts o...
This book offers Python programmers one place to look when they need help remembering or deciphering the syntax of this open source language and its many powerful but scantily documented modules. This comprehensive reference guide makes it easy to look up the most frequently needed information--not just about the Python language itself, but also the most frequently used parts of the standard library and the most important third-party extensions. Ask any Python aficionado and you'll hear that Python programmers have it all: an elegant object-oriented language with readable and maintainable syntax, that allows for easy integration with components in C, C++, Java, or C#, and an enormous collection of precoded standard library and third-party extension modules. Moreover, Python is easy to learn, yet powerful enough to take on the most ambitious programming challenges. But what Python programmers used to lack is a concise and clear reference resource, with the appropriate measure of guidance in how best to use Python's great power. Python in a Nutshell fills this need. Python in a Nutshell, Second Edition covers more than the language itself; it also deals with the most frequently used parts of the standard library, and the most popular and important third party extensions. Revised and expanded for Python 2.5, this book now contains the gory details of Python's new subprocess module and breaking news about Microsoft's new IronPython project. Our "Nutshell" format fits Python perfectly by presenting the highlights of the most important modules and functions in its standard library, which cover over 90% of your practical programming needs. This book includes: * A fast-paced tutorial on the syntax of the Python language * An explanation of object-oriented programming in Python * Coverage of iterators, generators, exceptions, modules, packages, strings, and regular expressions * A quick reference for Python's built-in types and functions and key modules * Reference material on important third-party extensions, such as Numeric and Tkinter * Information about extending and embedding Python Python in a Nutshell provides a solid, no-nonsense quick reference to information that programmers rely on the most. This book will immediately earn its place in any Python programmer's library. Praise for the First Edition: "In a nutshell, Python in a Nutshell serves one primary goal: to act as an immediately accessible goal for the Python language. True, you can get most of the same core information that is presented within the covers of this volume online, but this will invariably be broken into multiple files, and in all likelihood lacking the examples or the exact syntax description necessary to truly understand a command." --Richard Cobbett, Linux Format "O'Reilly has several good books, of which Python in a Nutshell by Alex Martelli is probably the best for giving you some idea of what Python is about and how to do useful things with it." --Jerry Pournelle, Byte Magazine
作者简介
· · · · · ·
Alex Martelli (born October 5, 1955) is an Italian computer engineer and member of the Python Software Foundation. Since early 2005, he works as "Über Tech Lead" for Google, Inc. in Mountain View, California. He holds a Laurea in Electrical Engineering from Bologna University (1980); he is the author of Python in a Nutshell, co-editor of the Python Cookbook, and has written oth...
Alex Martelli (born October 5, 1955) is an Italian computer engineer and member of the Python Software Foundation. Since early 2005, he works as "Über Tech Lead" for Google, Inc. in Mountain View, California. He holds a Laurea in Electrical Engineering from Bologna University (1980); he is the author of Python in a Nutshell, co-editor of the Python Cookbook, and has written other (mostly Python-related) materials. Martelli won the 2002 Activators' Choice Award, and the 2006 Frank Willison award for outstanding contributions to the Python community.
原文摘录
· · · · · ·
You can subclass any of the standard exception clases in order to define your own exception class. Often, such a subclass adds nothing more than a docstring.
A special case of custom exception class that you may sometims find useful is one that wraps another exception and adds further information. To gather information about a pending exception, you can use the `exc_info` function from module `sys`. (查看原文)
我只看了此书的Chapter 6 Exception,有帮助,很好的回答了最近困扰我的两个问题: (1)Why should we use exception in Python ? (2)When should I use exception in Python ? 与我的问题类似的的另一个问题:http://programmers.stackexchange.com/questions/219320/when-...
(展开)
0 有用 Alex 2007-08-25 08:37:25
细节真多,真详细。不适合作为初学者阅读的书。
0 有用 Renco 2015-08-05 21:31:59
什么时候出第三版..这版里讨论的是Python2.4,这书是06年出的。除了内容偏老以外,这本书是案头必备的文献。
0 有用 Suave 2010-06-20 12:11:29
肯能是 O'Reilly 早期出版的书吧,字体、排版不易读
0 有用 喔唷崩溃啦 2012-10-08 21:23:42
hand book ,获取了新知识
1 有用 没头苍蝇 2009-05-02 20:35:32
大部分开始学python的人应该都不是第一次接触编程吧,这样的话看这样的书反而会比较有效率。