Book description
Ask any Python aficionado and you'll hear that Python programmers have it all: an elegant language that offers object-oriented programming support, a readable, maintainable syntax, integration with C components, and an enormous collection of precoded standard library and extension modules. Moreover, Python is easy to learn but powerful enough to take on the most ambitious programming challenges. But what Python programmers have lacked is one concise and clear reference resource, with the appropriate measure of guidance in how best to use Python's great power. Now Python in a Nutshell fills this need. In the tradition of O'Reilly's "In a Nutshell" series, 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 modules. This comprehensive reference guide makes it easy to look up all 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. Python in a Nutshell focuses on Python 2.2 (and all its point releases), currently the most stable and widespread Python release. This book includes:
A fast-paced tutorial on the syntax of the Python language itself
An explanation of object-oriented programming in Python, covering both the classic and new-style object models
Coverage of other core topics, including exceptions, modules, strings, and regular expressions
A quick reference for Python's built-in types and functions, as well as the key modules in the Python standard library, including sys, os, time, thread, math, and socket, among many others
Reference material on important third-party extensions, such as Numeric and Tkinter
Information about extending Python and embedding it into other applications
Python in a Nutshell provides a solid, no-nonsense quick reference to information that programmers rely on the most. This latest addition to the best-selling "In a Nutshell" series will immediately earn its place in any Python programmer's library.
Publisher resources
Table of contents
-
Python in a Nutshell
- Preface
-
I. Getting Started with Python
- 1. Introduction to Python
- 2. Installation
- 3. The Python Interpreter
-
II. Core Python Language and Built-ins
- 4. The Python Language
-
5. Object-Oriented Python
- Classic Classes and Instances
- New-Style Classes and Instances
-
Special Methods
- General-Purpose Special Methods
- Special Methods for Containers
-
Special Methods for Numeric Objects
- __abs__, __invert__, __neg__, __pos__
- __add__, __div__, __floordiv__, __mod__, __mul__, __sub__,__truediv__
- __and__, __lshift__, __or__, __rshift__, __xor__
- __coerce__
- __complex__, __float__, __int__, __long__
- __divmod__
- __hex__, __oct__
- __iadd__, __idiv__, __ifloordiv__, __imod__, __imul__, __isub__, __itruediv__
- __iand__, __ilshift__, __ior__, __irshift__, __ixor__
- __ipow__
- __pow__
- __radd__, __rdiv__, __rmod__, __rmul__, __rsub__
- __rand__, __rlshift__, __ror__, __rrshift__, __rxor__
- __rdivmod__
- __rpow__
- Metaclasses
- 6. Exceptions
- 7. Modules
- 8. Core Built-ins
-
9. Strings and Regular Expressions
- Methods of String Objects
- The string Module
- String Formatting
- The pprint Module
- The repr Module
- Unicode
- Regular Expressions and the re Module
-
III. Python Library and Extension Modules
-
10. File and Text Operations
- The os Module
- Filesystem Operations
- File Objects
- Auxiliary Modules for File I/O
- The StringIO and cStringIO Modules
- Compressed Files
- Text Input and Output
- Richer-Text I/O
- Interactive Command Sessions
- Internationalization
- 11. Persistence and Databases
- 12. Time Operations
- 13. Controlling Execution
- 14. Threads and Processes
-
15. Numeric Processing
- The math and cmath Modules
- The operator Module
- The random Module
- The array Module
- The Numeric Package
- Array Objects
- Universal Functions (ufuncs)
- Optional Numeric Modules
-
16. Tkinter GUIs
- Tkinter Fundamentals
- Widget Fundamentals
- Commonly Used Simple Widgets
- Container Widgets
- Menus
- The Text Widget
- The Canvas Widget
- Geometry Management
- Tkinter Events
- 17. Testing, Debugging, and Optimizing
-
10. File and Text Operations
-
IV. Network and Web Programming
- 18. Client-Side Network Protocol Modules
-
19. Sockets and Server-Side Network Protocol Modules
- The socket Module
- The SocketServer Module
- Event-Driven Socket Programs
- 20. CGI Scripting and Alternatives
- 21. MIME and Network Encodings
- 22. Structured Text: HTML
-
23. Structured Text: XML
- An Overview of XML Parsing
- Parsing XML with SAX
- Parsing XML with DOM
- Changing and Generating XML
-
V. Extending and Embedding
-
24. Extending and Embedding Classic Python
-
Extending Python with Python’s C API
- Building and Installing C-Coded Python Extensions
- Overview of C-Coded Python Extension Modules
- Return Values of Python’s C API Functions
- Module Initialization
- Reference Counting
- Accessing Arguments
- Creating Python Values
- Exceptions
-
Abstract Layer Functions
- PyCallable_Check
- PyEval_CallObject
- PyEval_CallObjectWithKeywords
- PyIter_Check
- PyIter_Next
- PyNumber_Check
- PyObject_CallFunction
- PyObject_CallMethod
- PyObject_Cmp
- PyObject_DelAttrString
- PyObject_DelItem
- PyObject_DelItemString
- PyObject_GetAttrString
- PyObject_GetItem
- PyObject_GetItemString
- PyObject_GetIter
- PyObject_HasAttrString
- PyObject_IsTrue
- PyObject_Length
- PyObject_Repr
- PyObject_RichCompare
- PyObject_RichCompareBool
- PyObject_SetAttrString
- PyObject_SetItem
- PyObject_SetItemString
- PyObject_Str
- PyObject_Type
- PyObject_Unicode
- PySequence_Contains
- PySequence_DelSlice
- PySequence_Fast
- PySequence_Fast_GET_ITEM
- PySequence_Fast_GET_SIZE
- PySequence_GetSlice
- PySequence_List
- PySequence_SetSlice
- PySequence_Tuple
- PyNumber_Power
- Concrete Layer Functions
- A Simple Extension Example
- Defining New Types
- Extending Python Without Python’s C API
- Embedding Python
-
Extending Python with Python’s C API
- 25. Extending and Embedding Jython
- 26. Distributing Extensions and Programs
-
24. Extending and Embedding Classic Python
- Index
- Colophon
Product information
- Title: Python in a Nutshell
- Author(s):
- Release date: March 2003
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596001889
You might also like
book
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 3rd Edition
Through a recent series of breakthroughs, deep learning has boosted the entire field of machine learning. …
book
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 2nd Edition
Through a series of recent breakthroughs, deep learning has boosted the entire field of machine learning. …
book
Python Automation Cookbook - Second Edition
Get a firm grip on the core processes including browser automation, web scraping, Word, Excel, and …
book
Python One-Liners
Python One-Liners will teach you how to read and write “one-liners”: concise statements of useful functionality …