Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Buy Now $47.99
Standard view
Full view
of .
Look up keyword or section
Like this
3Activity

Table Of Contents

Language-based modules
What’s Python Not Good For?
Truth in Advertising
Chapter 2
CHAPTER 2
A Sneak Preview 2
“Programming Python: The Short Story”
The Task
Step 1: Representing Records
Nested structures
Dictionaries of dictionaries
Step 2: Storing Records Persistently
System Scripting Overview
Introducing the sys Module
Introducing the os Module
Administrative Tools
Script Execution Context
Current working directory
Current Working Directory
Command-Line Arguments
Shell Environment Variables
Executable Scripts on Unix
Standard Streams
Chapter 4
CHAPTER 4
File and Directory Tools 4
“Erase Your Hard Drive in Five Easy Steps!”
File Tools
Directory Tools
Chapter 5
CHAPTER 5
Parallel System Tools5
“Telling the Monkeys What to Do”
Forking Processes
The fork/exec Combination
Threads
The Global Interpreter Lock and Threads
Program Exits
Interprocess Communication
Pipes
Signals
Other Ways to Start Programs
A Portable Program-Launch Framework
Other System Tools
Chapter 6
CHAPTER 6
System Examples: Utilities 6
“Splits and Joins and Alien Invasions”
Splitting and Joining Files
Generating Forward-Link Web Pages
A Regression Test Script
Packing and Unpacking Files
Automated Program Launchers
A Portable Media File Player Tool
Chapter 7
CHAPTER 7
System Examples: Directories 7
“The Greps of Wrath”
Fixing DOS Line Ends
Fixing DOS Filenames
Searching Directory Trees
Visitor: Walking Trees Generically
Copying Directory Trees
Deleting Directory Trees
Comparing Directory Trees
Reporting Differences
PART III
III.GUI Programming
Chapter 8
CHAPTER 8
Graphical User Interfaces8
“Here’s Looking at You, Kid”
Python GUI Development Options
Tkinter Overview
Climbing the GUI Learning Curve
Tkinter Coding Basics
Tkinter Coding Alternatives
Adding Buttons and Callbacks
Adding User-Defined Callback Handlers
Adding Multiple Widgets
Customizing Widgets with Classes
Reusable GUI Components with Classes
Standalone Container Classes
The End of the Tutorial
Python/Tkinter for Tcl/Tk Converts
Chapter 9
CHAPTER 9
A Tkinter Tour, Part 1 9
“Widgets and Gadgets and GUIs, Oh My!”
Configuring Widget Appearance
Top-Level Windows
Dialogs
Binding Events
Message and Entry
Checkbutton, Radiobutton, and Scale
Running GUI Code Three Ways
Images
Viewing and Processing Images with PIL
Chapter 10
CHAPTER 10
A Tkinter Tour, Part 210
“On Today’s Menu: Spam, Spam, and Spam”
Menus
Listboxes and Scrollbars
Text
Canvas
Scrolling Canvases
Grids
Time Tools, Threads, and Animation
More Ways to Add GUIs to Non-GUI Code
Chapter 12
CHAPTER 12
Complete GUI Programs 12
“Python, Open Source, and Camaros”
PyEdit: A Text Editor Program/Object
PyPhoto: An Image Viewer and Resizer
PyView: An Image and Notes Slideshow
PyDraw: Painting and Moving Graphics
Handling Multiple Clients
A Simple Python File Server
Making Sockets Look Like Files
Chapter 14
CHAPTER 14
Client-Side Scripting 14
“Socket to Me!”
FTP: Transferring Files over the Net
Processing Internet Email
POP: Fetching Email
SMTP: Sending Email
email: Parsing and Composing Mails
pymail: A Console-Based Email Client
The mailtools Utility Package
NNTP: Accessing Newsgroups
HTTP: Accessing Web Sites
Module urllib Revisited
Other Client-Side Scripting Options
Chapter 15
CHAPTER 15
The PyMailGUI Client 15
“Use the Source, Luke”
A PyMailGUI Demo
Load Server Interface
PyMailGUI Implementation
Chapter 16
CHAPTER 16
Server-Side Scripting 16
“Oh What a Tangled Web We Weave”
What’s a Server-Side CGI Script?
Running Server-Side Examples
Climbing the CGI Learning Curve
Saving State Information in CGI Scripts
The Hello World Selector
Refactoring Code for Maintainability
More on HTML and URL Escapes
Transferring Files to Clients and Servers
Chapter 17
CHAPTER 17
The PyMailCGI Server17
“Things to Do When Visiting Chicago”
The PyMailCGI Web Site
The Root Page
Sending Mail by SMTP
Reading POP Email
Processing Fetched Mail
Utility Modules
CGI Script Trade-Offs
Chapter 18
CHAPTER 18
Advanced Internet Topics18
“Surfing on the Shoulders of Giants”
Zope: A Web Application Framework
HTML document templates
HTMLgen: Web Pages from Objects
Jython: Python for Java
Grail: A Python-Based Web Browser
XML Processing Tools
The Missing rexec Section
Windows Web Scripting Extensions
Python Server Pages
Rolling Your Own Servers in Python
And Other Cool Stuff
PART V
V.Tools and Techniques
Chapter 19
CHAPTER 19
Databases and Persistence19
“Give Me an Order of Persistence, but Hold the Pickles”
Persistence Options in Python
DBM Files
Pickled Objects
Shelve Files
The ZODB Object-Oriented Database
SQL Database Interfaces
PyForm: A Persistent Object Viewer
Chapter 20
CHAPTER 20
Data Structures 20
“Roses Are Red, Violets Are Blue; Lists Are Mutable, and So Is Set Foo”
Implementing Stacks
Implementing Sets
Subclassing Built-In Types
Binary Search Trees
Graph Searching
Reversing Sequences
Permuting Sequences
Sorting Sequences
Data Structures Versus Python Built-Ins
PyTree: A Generic Tree Object Viewer
Chapter 21
CHAPTER 21
Text and Language 21
“See Jack Hack. Hack, Jack, Hack”
Strategies for Parsing Text in Python
String Method Utilities
Regular Expression Pattern Matching
Compiled pattern objects
Advanced Language Tools
Handcoded Parsers
PyCalc: A Calculator Program/Object
PART VI
VI.Integration
Basic Embedding Techniques
Precompiling Strings to Bytecode
Registering Callback Handler Objects
Using Python Classes in C
A High-Level Embedding API: ppembed
Running Customizable Validations
Other Integration Topics
PART VII
Chapter 24
CHAPTER 24
Conclusion: Python and the Development Cycle24
“That’s the End of the Book, Now Here’s the Meaning of Life”
“Something’s Wrong with the Way We Program Computers”
The “Gilligan Factor”
The Static Language Build Cycle
But What About That Bottleneck?
So What’s “Python: The Sequel”?
Postscript to the Second Edition (2000)
Postscript to the Third Edition (2006)
Index
P. 1
Programming Python

Programming Python

Ratings:

3.37

(75)
|Views: 4,502 |Likes:

Already the industry standard for Python users, ProgrammingPython fromO'Reilly just got even better. This third edition has been updated toreflect current best practices andthe abundance of changes introduced by the latest version of thelanguage, Python 2.5.

Whether you're a novice or an advancedpractitioner, you'll find thisrefreshed book more than lives up to its reputation. ProgrammingPython, 3rd Edition, teaches you the rightway to code. It explains Python language syntax and programmingtechniques in a clear and concisemanner, with numerous examples that illustrate both correct usage andcommon idioms. By reading thiscomprehensive guide, you'll learn how to apply Python in real-worldproblem domains such as:

GUI programming Internet scripting Parallel processing Database management Networked applications

Programming Python, Third Edition coverseach of thesetarget domainsgradually, beginning with in-depth discussions of core concepts andthen progressing toward completeprograms. Large examples do appear, but only after you've learnedenough to understand their techniques andcode.

Along the way, you'll also learn how to use the Python language inrealistically scaled programs--concepts such as Object-Oriented Programming (OOP) and code reuseare recurring side themes throughout thistext. If you're interested in Python programming, then this O'Reillyclassic needs to be within arm's reach. Thewealth of practical advice, snippets of code, and patterns of programdesign can all be put into use on adaily basis--making your life easier and more productive.

Reviews of the second edition:

"...about as comprehensive as any book can be."
--Dr. Dobb's Journal

"If the language had manuals, they would undoubtedlybe the texts from O'Reilly...'Learning Python' and 'Programming Python'are definitive treatments."
--SD Times

Already the industry standard for Python users, ProgrammingPython fromO'Reilly just got even better. This third edition has been updated toreflect current best practices andthe abundance of changes introduced by the latest version of thelanguage, Python 2.5.

Whether you're a novice or an advancedpractitioner, you'll find thisrefreshed book more than lives up to its reputation. ProgrammingPython, 3rd Edition, teaches you the rightway to code. It explains Python language syntax and programmingtechniques in a clear and concisemanner, with numerous examples that illustrate both correct usage andcommon idioms. By reading thiscomprehensive guide, you'll learn how to apply Python in real-worldproblem domains such as:

GUI programming Internet scripting Parallel processing Database management Networked applications

Programming Python, Third Edition coverseach of thesetarget domainsgradually, beginning with in-depth discussions of core concepts andthen progressing toward completeprograms. Large examples do appear, but only after you've learnedenough to understand their techniques andcode.

Along the way, you'll also learn how to use the Python language inrealistically scaled programs--concepts such as Object-Oriented Programming (OOP) and code reuseare recurring side themes throughout thistext. If you're interested in Python programming, then this O'Reillyclassic needs to be within arm's reach. Thewealth of practical advice, snippets of code, and patterns of programdesign can all be put into use on adaily basis--making your life easier and more productive.

Reviews of the second edition:

"...about as comprehensive as any book can be."
--Dr. Dobb's Journal

"If the language had manuals, they would undoubtedlybe the texts from O'Reilly...'Learning Python' and 'Programming Python'are definitive treatments."
--SD Times

More info:

Publish date: 1996
Added to Scribd: May 16, 2009
Copyright:Traditional Copyright: All rights reservedISBN:9780596529420
List Price: $47.99 Buy Now

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

10/01/2014

1598

9780596529420

$47.99

USD

pdf

original

You're Reading a Free Preview
Pages 64 to 79 are not shown in this preview.
You're Reading a Free Preview
Pages 143 to 605 are not shown in this preview.
You're Reading a Free Preview
Pages 669 to 720 are not shown in this preview.
You're Reading a Free Preview
Pages 784 to 1447 are not shown in this preview.
You're Reading a Free Preview
Pages 1511 to 1598 are not shown in this preview.

Activity (3)

You've already reviewed this. Edit your review.
kalafjj reviewed this
Rated 1/5
Very disappointing. One of the worst O'Reilly books I've come across. Don't let the size deceive you... there is not much useful information here. The index is particularly shocking. I second the other recommendation for "Python Essential Reference".
biniaraixa added this note
Genial!
biniaraixa added this note
Muy bueno!
biniaraixa liked this
1 hundred reads
1 thousand reads
1 hundred thousand reads
om999 liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->