- Home
- Computers & IT
- Dive Into Python
Dive Into Python
Book Description:
Dive Into Python is a Python book for experienced programmers. Whether you’re an experienced programmer looking to get into Python or grizzled Python veteran who remembers the days when you had to import the string module, Dive Into Python is your ’desert island’ Python book. If you’ve never programmed before, Python is an excellent language to learn modern programming techniques. But this book should not be your starting point. Get "How to Think Like a Computer Scientist: Learning with Python" by Allen Downey, Jeffrey Elkner, Chris Meyers and learn the basics. Then dive into this book. Dive Into PYTHON was written by Mark Pilgram and is distributed under the GNU Free Documentation License. * Money raised from the sale of this book supports the development of free software and documentation.
Table of Contents
* 1. Installing Python
o 1.1. Which Python is right for you?
o 1.2. Python on Windows
o 1.3. Python on Mac OS X
o 1.4. Python on Mac OS 9
o 1.5. Python on RedHat Linux
o 1.6. Python on Debian GNU/Linux
o 1.7. Python Installation from Source
o 1.8. The Interactive Shell
o 1.9. Summary
* 2. Your First Python Program
o 2.1. Diving in
o 2.2. Declaring Functions
+ 2.2.1. How Python’s Datatypes Compare to Other Programming Languages
o 2.3. Documenting Functions
o 2.4. Everything Is an Object
+ 2.4.1. The Import Search Path
+ 2.4.2. What’s an Object?
o 2.5. Indenting Code
o 2.6. Testing Modules
* 3. Native Datatypes
o 3.1. Introducing Dictionaries
+ 3.1.1. Defining Dictionaries
+ 3.1.2. Modifying Dictionaries
+ 3.1.3. Deleting Items From Dictionaries
o 3.2. Introducing Lists
+ 3.2.1. Defining Lists
+ 3.2.2. Adding Elements to Lists
+ 3.2.3. Searching Lists
+ 3.2.4. Deleting List Elements
+ 3.2.5. Using List Operators
o 3.3. Introducing Tuples
o 3.4. Declaring variables
+ 3.4.1. Referencing Variables
+ 3.4.2. Assigning Multiple Values at Once
o 3.5. Formatting Strings
o 3.6. Mapping Lists
o 3.7. Joining Lists and Splitting Strings
+ 3.7.1. Historical Note on String Methods
o 3.8. Summary
* 4. The Power Of Introspection
o 4.1. Diving In
o 4.2. Using Optional and Named Arguments
o 4.3. Using type, str, dir, and Other Built-In Functions
+ 4.3.1. The type Function
+ 4.3.2. The str Function
+ 4.3.3. Built-In Functions
o 4.4. Getting Object References With getattr
+ 4.4.1. getattr with Modules
+ 4.4.2. getattr As a Dispatcher
o 4.5. Filtering Lists
o 4.6. The Peculiar Nature of and and or
+ 4.6.1. Using the and-or Trick
o 4.7. Using lambda Functions
+ 4.7.1. Real-World lambda Functions
o 4.8. Putting It All Together
o 4.9. Summary
* 5. Objects and Object-Orientation
o 5.1. Diving In
o 5.2. Importing Modules Using from module import
o 5.3. Defining Classes
+ 5.3.1. Initializing and Coding Classes
+ 5.3.2. Knowing When to Use self and __init__
o 5.4. Instantiating Classes
+ 5.4.1. Garbage Collection
o 5.5. Exploring UserDict: A Wrapper Class
o 5.6. Special Class Methods
+ 5.6.1. Getting and Setting Items
o 5.7. Advanced Special Class Methods
o 5.8. Introducing Class Attributes
o 5.9. Private Functions
o 5.10. Summary
* 6. Exceptions and File Handling
o 6.1. Handling Exceptions
+ 6.1.1. Using Exceptions For Other Purposes
o 6.2. Working with File Objects
+ 6.2.1. Reading Files
+ 6.2.2. Closing Files
+ 6.2.3. Handling I/O Errors
+ 6.2.4. Writing to Files
o 6.3. Iterating with for Loops
o 6.4. Using sys.modules
o 6.5. Working with Directories
o 6.6. Putting It All Together
o 6.7. Summary
* 7. Regular Expressions
o 7.1. Diving In
o 7.2. Case Study: Street Addresses
o 7.3. Case Study: Roman Numerals
+ 7.3.1. Checking for Thousands
+ 7.3.2. Checking for Hundreds
o 7.4. Using the {n,m} Syntax
+ 7.4.1. Checking for Tens and Ones
o 7.5. Verbose Regular Expressions
o 7.6. Case study: Parsing Phone Numbers
o 7.7. Summary
* 8. HTML Processing
o 8.1. Diving in
o 8.2. Introducing sgmllib.py
o 8.3. Extracting data from HTML documents
o 8.4. Introducing BaseHTMLProcessor.py
o 8.5. locals and globals
o 8.6. Dictionary-based string formatting
o 8.7. Quoting attribute values
o 8.8. Introducing dialect.py
o 8.9. Putting it all together
o 8.10. Summary
* 9. XML Processing
o 9.1. Diving in
o 9.2. Packages
o 9.3. Parsing XML
o 9.4. Unicode
o 9.5. Searching for elements
o 9.6. Accessing element attributes
o 9.7. Segue
* 10. Scripts and Streams
o 10.1. Abstracting input sources
o 10.2. Standard input, output, and error
o 10.3. Caching node lookups
o 10.4. Finding direct children of a node
o 10.5. Creating separate handlers by node type
o 10.6. Handling command-line arguments
o 10.7. Putting it all together
o 10.8. Summary
* 11. HTTP Web Services
o 11.1. Diving in
o 11.2. How not to fetch data over HTTP
o 11.3. Features of HTTP
+ 11.3.1. User-Agent
+ 11.3.2. Redirects
+ 11.3.3. Last-Modified/If-Modified-Since
+ 11.3.4. ETag/If-None-Match
+ 11.3.5. Compression
o 11.4. Debugging HTTP web services
o 11.5. Setting the User-Agent
o 11.6. Handling Last-Modified and ETag
o 11.7. Handling redirects
o 11.8. Handling compressed data
o 11.9. Putting it all together
o 11.10. Summary
* 12. SOAP Web Services
o 12.1. Diving In
o 12.2. Installing the SOAP Libraries
+ 12.2.1. Installing PyXML
+ 12.2.2. Installing fpconst
+ 12.2.3. Installing SOAPpy
o 12.3. First Steps with SOAP
o 12.4. Debugging SOAP Web Services
o 12.5. Introducing WSDL
o 12.6. Introspecting SOAP Web Services with WSDL
o 12.7. Searching Google
o 12.8. Troubleshooting SOAP Web Services
o 12.9. Summary
* 13. Unit Testing
o 13.1. Introduction to Roman numerals
o 13.2. Diving in
o 13.3. Introducing romantest.py
o 13.4. Testing for success
o 13.5. Testing for failure
o 13.6. Testing for sanity
* 14. Test-First Programming
o 14.1. roman.py, stage 1
o 14.2. roman.py, stage 2
o 14.3. roman.py, stage 3
o 14.4. roman.py, stage 4
o 14.5. roman.py, stage 5
* 15. Refactoring
o 15.1. Handling bugs
o 15.2. Handling changing requirements
o 15.3. Refactoring
o 15.4. Postscript
o 15.5. Summary
* 16. Functional Programming
o 16.1. Diving in
o 16.2. Finding the path
o 16.3. Filtering lists revisited
o 16.4. Mapping lists revisited
o 16.5. Data-centric programming
o 16.6. Dynamically importing modules
o 16.7. Putting it all together
o 16.8. Summary
* 17. Dynamic functions
o 17.1. Diving in
o 17.2. plural.py, stage 1
o 17.3. plural.py, stage 2
o 17.4. plural.py, stage 3
o 17.5. plural.py, stage 4
o 17.6. plural.py, stage 5
o 17.7. plural.py, stage 6
o 17.8. Summary
* 18. Performance Tuning
o 18.1. Diving in
o 18.2. Using the timeit Module
o 18.3. Optimizing Regular Expressions
o 18.4. Optimizing Dictionary Lookups
o 18.5. Optimizing List Operations
o 18.6. Optimizing String Manipulation
o 18.7. Summary
* A. Further reading
* B. A 5-minute review
* C. Tips and tricks
* D. List of examples
* E. Revision history
* F. About the book
* G. GNU Free Documentation License
o G.0. Preamble
o G.1. Applicability and definitions
o G.2. Verbatim copying
o G.3. Copying in quantity
o G.4. Modifications
o G.5. Combining documents
o G.6. Collections of documents
o G.7. Aggregation with independent works
o G.8. Translation
o G.9. Termination
o G.10. Future revisions of this license
o G.11. How to use this License for your documents
* H. Python license
o H.A. History of the software
o H.B. Terms and conditions for accessing or otherwise using Python
+ H.B.1. PSF license agreement
+ H.B.2. BeOpen Python open source license agreement version 1
+ H.B.3. CNRI open source GPL-compatible license agreement
+ H.B.4. CWI permissions statement and disclaimer
Direct Download Links:
- Permission is granted to copy, distribute, and/or modify this document under the terms of the GNU Free Documentation License
- download the pdf ebook
- www.diveintopytho...ython-pdf-5.4.zip
- more
- www.diveintopytho...veintopython.net/
Related Books at ISBNlib
- Python Essential Reference (4th Edition)
- The Definitive Guide to Django: Web Development Done Right, Second Edition
- Learning Python: Powerful Object-Oriented Programming
- Python Cookbook
- Python in a Nutshell, Second Edition (In a Nutshell (O’Reilly))