Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Contents
Title
Copyright
Dedication
About the Author
Credits
Acknowledgments
Introduction
Part I: Dipping Your Toe into Python
Chapter 1: Programming Basics and Strings
How Programming is Different from Using a Computer
The First Steps
Beginning to Use Python — Strings
Putting Two Strings Together
Putting Strings Together in Different Ways
Summary
Exercises
Chapter 2: Numbers and Operators
Different Kinds of Numbers
Program Files
Using Numbers
Summary
Exercises
Chapter 3: Variables — Names for Values
Referring to Data — Using Names for Data
Using More Built-in Types
Other Common Sequence Properties
Summary
Exercises
Part II: Python Language and the Standard Library
Chapter 4: Making Decisions
Comparing Values — Are They the Same?
Doing the Opposite — Not Equal
Comparing Values — Which One Is More?
Reversing True and False
Looking for the Results of More Than One Comparison
Repetition
Handling Errors
Summary
Exercises
Chapter 5: Functions
Putting Your Program into Its Own File
Functions: Grouping Code under a Name
Layers of Functions
Summary
Exercises
Chapter 6: Classes and Objects
Thinking About Programming
Defining a Class
Summary
Exercises
Chapter 7: Organizing Programs
Modules
Packages
Modules and Packages
Basics of Testing Your Modules and Packages
Summary
Exercises
Chapter 8: Files and Directories
File Objects
Paths and Directories
Exceptions in os
Summary
Exercises
Chapter 9: Other Features of the Language
Lambda and Filter: Short Anonymous Functions
Map: Short-Circuiting Loops
Decisions within Lists — List Comprehension
Generating Iterators for Loops
Special String Substitution Using Dictionaries
Featured Modules
Summary
Exercises
Chapter 10: Building a Module
Exploring Modules
Creating Modules and Packages
Working with Classes
Finishing Your Modules
Creating a Whole Module
Installing Your Modules
Summary
Exercises
Chapter 11: Text Processing
Why Text Processing Is So Useful
Navigating the File System with the os Module
Working with Regular Expressions and the re Module
Summary
Exercises
Part III: Putting Python to Work
Chapter 12: Testing
Assertions
Test Cases and Test Suites
Test Fixtures
Putting It All Together with Extreme Programming
Formal Testing in the Software Life Cycle
Summary
Chapter 13: Writing a Gui with Python
GUI Programming Toolkits for Python
Tkinter Introduction
Creating GUI Widgets with Tkinter
Summary
Exercises
Chapter 14: Accessing Databases
Working with DBM Persistent Dictionaries
Working with Relational Databases
Using the Python Database APIs
Summary
Exercises
Chapter 15: Using Python for XML
What Is XML?
What Is a Schema/DTD?
Document Type Definitions
Schemas
XPath
HTML as a Subset of XML
XML Libraries Available for Python
What Is SAX?
Why Use SAX or DOM
SAX and DOM Parsers Available for Python
Intro to XSLT
What Is lxml?
Element Classes
Parsing with lxml
Summary
Exercises
Chapter 16: Network Programming
Understanding Protocols
Sending Internet E-mail
Retrieving Internet E-mail
Socket Programming
Other Topics
Summary
Exercises
Chapter 17: Extension Programming with C
Extension Module Outline
Building and Installing Extension Modules
Passing Parameters from Python to C
Returning Values from C to Python
The LAME Project
The LAME Extension Module
Using Python Objects from C Code
Summary
Exercises
Chapter 18: Numerical Programming
Numbers in Python
Mathematics
Complex Numbers
Arrays
Summary
Exercises
Chapter 19: An Introduction to Django
What Are Frameworks and Why Would I Use One?
Other Features of Web Frameworks
Django — How It All Began
Understanding Django’s Architecture
Working with Templates
Using Templates and Views
Creating a Model: Creating an Application
Summary
Exercises
Chapter 20: Web Applications and Web Services
REST: The Architecture of the Web
HTTP: Real-World REST
CGI: Turning Scripts into Web Applications
HTML Forms’ Limited Vocabulary
Safety When Accessing Form Values
Building a Wiki
Web Services
REST Web Services
XML-RPC
SOAP
Documenting Your Web Service API
Choosing a Web Service Standard
Web Service Etiquette
Summary
Exercises
Chapter 21: Integrating Java with Python
Scripting within Java Applications
Comparing Python Implementations
Installing Jython
Running Jython
Running Jython on Your Own
Packaging Jython-Based Applications
Integrating Java and Jython
Testing from Jython
Embedding the Jython Interpreter
Handling Differences between C-Python and Jython
Summary
Exercises
Part IV: Appendices
Appendix A: Answers to the Exercises
Appendix B: Online Resources
Appendix C: What’s New in Python 3.1
Appendix D: Glossary
Index
← Prev
Back
Next →
← Prev
Back
Next →