Programming Python (4TH)

個数:

Programming Python (4TH)

  • 提携先の海外書籍取次会社に在庫がございます。通常2週間で発送いたします。
    重要ご説明事項
    1. 納期遅延や、ご入手不能となる場合が若干ございます。
    2. 複数冊ご注文の場合、分割発送となる場合がございます。
    3. 美品のご指定は承りかねます。

  • 提携先の海外書籍取次会社に在庫がございます。通常約2週間で発送いたします。
    重要ご説明事項
    1. 納期遅延や、ご入手不能となる場合が若干ございます。
    2. 複数冊ご注文の場合、分割発送となる場合がございます。
    3. 美品のご指定は承りかねます。
  • ≪洋書のご注文につきまして≫ 「海外取次在庫あり」および「国内仕入れ先からお取り寄せいたします」表示の商品でも、納期の目安期間内にお届けできないことがございます。あらかじめご了承ください。

  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 1584 p.
  • 言語 ENG,ENG
  • 商品コード 9780596158101
  • DDC分類 005.133

Full Description


Once you've come to grips with the core Python language, learning how to build Python applications presents a far more interesting challenge. Tap this book's wealth of practical advice, snippets of code, and patterns of program design to take your Python skills to the next level. You'll start with in-depth discussions of core concepts and then progress toward complete programs in different application domains, including: * GUI programming * Internet scripting * Parallel processing * Database management * Networked applications * System administration * Text processing Most programming experts consider this classic book, now updated for Python 3.x, to be the industry standard for learning Python application programming. With clear and concise explanations of Python syntax and programming techniques, and numerous examples that illustrate both correct usage and common idioms, Programming Python shows you the right way to code with Python.

Table of Contents

Preface                                            xxiii
Part I The Beginning
1 A Sneak Preview 3 (70)
"Programming Python: The Short Story" 3 (1)
The Task 4 (1)
Step 1 Representing Records 4 (10)
Using Lists 4 (5)
Using Dictionaries 9 (5)
Step 2 Storing Records Persistently 14 (12)
Using Formatted Files 14 (5)
Using Pickle Files 19 (3)
Using Per-Record Pickle Files 22 (1)
Using Shelves 23 (3)
Step 3 Stepping Up to OOP 26 (11)
Using Classes 27 (2)
Adding Behavior 29 (1)
Adding Inheritance 29 (2)
Refactoring Code 31 (3)
Adding Persistence 34 (2)
Other Database Options 36 (1)
Step 4 Adding Console Interaction 37 (3)
A Console Shelve Interface 37 (3)
Step 5 Adding a GUI 40 (12)
GUI Basics 40 (2)
Using OOP for GUIs 42 (2)
Getting Input from a User 44 (2)
A GUI Shelve Interface 46 (6)
Step 6 Adding a Web Interface 52 (17)
CGI Basics 52 (3)
Running a Web Server 55 (2)
Using Query Strings and urllib 57 (2)
Formatting Reply Text 59 (1)
A Web-Based Shelve Interface 60 (9)
The End of the Demo 69 (4)
Part II System Programming
2 System Tools 73 (30)
"The os.path to Knowledge" 73 (2)
Why Python Here? 73 (1)
The Next Five Chapters 74 (1)
System Scripting Overview 75 (11)
Python System Modules 76 (1)
Module Documentation Sources 77 (1)
Paging Documentation Strings 78 (1)
A Custom Paging Script 79 (1)
String Method Basics 80 (2)
Other String Concepts in Python 3.X: 82 (1)
Unicode and bytes
File Operation Basics 83 (1)
Using Programs in Two Ways 84 (1)
Python Library Manuals 85 (1)
Commercially Published References 86 (1)
Introducing the sys Module 86 (4)
Platforms and Versions 86 (1)
The Module Search Path 87 (1)
The Loaded Modules Table 88 (1)
Exception Details 89 (1)
Other sys Module Exports 90 (1)
Introducing the os Module 90 (13)
Tools in the os Module 90 (1)
Administrative Tools 91 (1)
Portability Constants 92 (1)
Common os.path Tools 92 (2)
Running Shell Commands from Scripts 94 (6)
Other os Module Exports 100 (3)
3 Script Execution Context 103 (32)
"I'd Like to Have an Argument, Please" 103 (1)
Current Working Directory 104 (2)
CWD, Files, and Import Paths 104 (2)
CWD and Command Lines 106 (1)
Command-Line Arguments 106 (3)
Parsing Command-Line Arguments 107 (2)
Shell Environment Variables 109 (4)
Fetching Shell Variables 110 (1)
Changing Shell Variables 111 (1)
Shell Variable Fine Points: Parents, 112 (1)
putenv, and getenv
Standard Streams 113 (22)
Redirecting Streams to Files and 114 (5)
Programs
Redirected Streams and User Interaction 119 (4)
Redirecting Streams to Python Objects 123 (3)
The io.StringIO and io.BytesIO Utility 126 (1)
Classes
Capturing the stderr Stream 127 (1)
Redirection Syntax in Print Calls 127 (1)
Other Redirection Options: os.popen and 128 (7)
subprocess Revisited
4 File and Directory Tools 135 (42)
"Erase Your Hard Drive in Five Easy 135 (1)
Steps!"
File Tools 135 (28)
The File Object Model in Python 3.X 136 (1)
Using Built-in File Objects 137 (9)
Binary and Text Files 146 (9)
Lower-Level File Tools in the os Module 155 (5)
File Scanners 160 (3)
Directory Tools 163 (14)
Walking One Directory 164 (4)
Walking Directory Trees 168 (4)
Handling Unicode Filenames in 3.X: 172 (5)
listdir, walk, glob
5 Parallel System Tools 177 (94)
"Telling the Monkeys What to Do" 177 (2)
Forking Processes 179 (7)
The fork/exec Combination 182 (4)
Threads 186 (27)
The _thread Module 189 (10)
The threading Module 199 (5)
The queue Module 204 (4)
Preview: GUIs and Threads 208 (3)
More on the Global Interpreter Lock 211 (2)
Program Exits 213 (9)
sys Module Exits 214 (1)
os Module Exits 215 (1)
Shell Command Exit Status Codes 216 (3)
Process Exit Status and Shared State 219 (1)
Thread Exits and Shared State 220 (2)
Interprocess Communication 222 (21)
Anonymous Pipes 224 (10)
Named Pipes (Fifos) 234 (2)
Sockets: A First Look 236 (4)
Signals 240 (3)
The multiprocessing Module 243 (15)
Why multiprocessing? 243 (2)
The Basics: Processes and Locks 245 (3)
IPC Tools: Pipes, Shared Memory, and 248 (6)
Queues
Starting Independent Programs 254 (2)
And Much More... 256 (1)
Why multiprocessing? The Conclusion 257 (1)
Other Ways to Start Programs 258 (5)
The os.spawn Calls 258 (3)
The os.startfile call on Windows 261 (2)
A Portable Program-Launch Framework 263 (5)
Other System Tools Coverage 268 (3)
6 Complete System Programs 271 (84)
"The Greps of Wrath" 271 (1)
A Quick Game of "Find the Biggest Python 272 (10)
File"
Scanning the Standard Library Directory 272 (1)
Scanning the Standard Library Tree 273 (1)
Scanning the Module Search Path 274 (2)
Scanning the Entire Machine 276 (3)
Printing Unicode Filenames 279 (3)
Splitting and Joining Files 282 (10)
Splitting Files Portably 283 (3)
Joining Files Portably 286 (3)
Usage Variations 289 (3)
Generating Redirection Web Pages 292 (5)
Page Template File 293 (1)
Page Generator Script 294 (3)
A Regression Test Script 297 (7)
Running the Test Driver 299 (5)
Copying Directory Trees 304 (4)
Comparing Directory Trees 308 (11)
Finding Directory Differences 309 (2)
Finding Tree Differences 311 (3)
Running the Script 314 (2)
Verifying Backups 316 (1)
Reporting Differences and Other Ideas 317 (2)
Searching Directory Trees 319 (11)
Greps and Globs and Finds 320 (1)
Rolling Your Own find Module 321 (3)
Cleaning Up Bytecode Files 324 (3)
A Python Tree Searcher 327 (3)
Visitor: Walking Directories "++" 330 (13)
Editing Files in Directory Trees 334 (2)
(Visitor)
Global Replacements in Directory Trees 336 (2)
(Visitor)
Counting Source Code Lines (Visitor) 338 (1)
Recoding Copies with Classes (Visitor) 339 (2)
Other Visitor Examples (External) 341 (2)
Playing Media Files 343 (8)
The Python webbrowser Module 347 (1)
The Python mimetypes Module 348 (2)
Running the Script 350 (1)
Automated Program Launchers (External) 351 (4)
Part III GUI Programming
7 Graphical User Interfaces 355 (60)
"Here's Looking at You, Kid" 355 (3)
GUI Programming Topics 355 (2)
Running the Examples 357 (1)
Python GUI Development Options 358 (5)
tkinter Overview 363 (5)
tkinter Pragmatics 363 (1)
tkinter Documentation 364 (1)
tkinter Extensions 364 (2)
tkinter Structure 366 (2)
Climbing the GUI Learning Curve 368 (4)
"Hello World" in Four Lines (or Less) 368 (1)
tkinter Coding Basics 369 (1)
Making Widgets 370 (1)
Geometry Managers 370 (1)
Running GUI Programs 371 (1)
tkinter Coding Alternatives 372 (7)
Widget Resizing Basics 373 (2)
Configuring Widget Options and Window 375 (1)
Titles
One More for Old Times' Sake 376 (1)
Packing Widgets Without Saving Them 377 (2)
Adding Buttons and Callbacks 379 (3)
Widget Resizing Revisited: Expansion 380 (2)
Adding User-Defined Callback Handlers 382 (13)
Lambda Callback Handlers 383 (1)
Deferring Calls with Lambdas and Object 384 (1)
References
Callback Scope Issues 385 (6)
Bound Method Callback Handlers 391 (1)
Callable Class Object Callback Handlers 392 (1)
Other tkinter Callback Protocols 393 (1)
Binding Events 394 (1)
Adding Multiple Widgets 395 (5)
Widget Resizing Revisited: Clipping 396 (1)
Attaching Widgets to Frames 397 (1)
Layout: Packing Order and Side 397 (1)
Attachments
The Packer's Expand and Fill Revisited 398 (1)
Using Anchor to Position Instead of 399 (1)
Stretch
Customizing Widgets with Classes 400 (3)
Standardizing Behavior and Appearance 401 (2)
Reusable GUI Components with Classes 403 (7)
Attaching Class Components 405 (2)
Extending Class Components 407 (1)
Standalone Container Classes 408 (2)
The End of the Tutorial 410 (2)
Python/tkinter for Tcl/Tk Converts 412 (3)
8 A tkinter Tour, Part 1 415 (92)
"Widgets and Gadgets and GUIs, Oh My!" 415 (1)
This Chapter's Topics 415 (1)
Configuring Widget Appearance 416 (3)
Top-Level Windows 419 (7)
Toplevel and Tk Widgets 421 (1)
Top-Level Window Protocols 422 (4)
Dialogs 426 (17)
Standard (Common) Dialogs 426 (12)
The Old-Style Dialog Module 438 (1)
Custom Dialogs 439 (4)
Binding Events 443 (5)
Other bind Events 447 (1)
Message and Entry 448 (9)
Message 448 (1)
Entry 449 (2)
Laying Out Input Forms 451 (3)
tkinter "Variables" and Form Layout 454 (3)
Alternatives
Checkbutton, Radiobutton, and Scale 457 (14)
Checkbuttons 457 (5)
Radio Buttons 462 (5)
Scales (Sliders) 467 (4)
Running GUI Code Three Ways 471 (13)
Attaching Frames 471 (5)
Independent Windows 476 (2)
Running Programs 478 (6)
Images 484 (7)
Fun with Buttons and Pictures 487 (4)
Viewing and Processing Images with PIL 491 (16)
PIL Basics 491 (2)
Displaying Other Image Types with PIL 493 (3)
Creating Image Thumbnails with PIL 496 (11)
9 A tkinter Tour, Part 2 507 (90)
"On Today's Menu: Spam, Spam, and Spam" 507 (1)
Menus 507 (15)
Top-Level Window Menus 508 (4)
Frame- and Menubutton-Based Menus 512 (5)
Windows with Both Menus and Toolbars 517 (5)
Listboxes and Scrollbars 522 (6)
Programming Listboxes 524 (1)
Programming Scroll Bars 525 (1)
Packing Scroll Bars 526 (2)
Text 528 (22)
Programming the Text Widget 530 (3)
Adding Text-Editing Operations 533 (5)
Unicode and the Text Widget 538 (10)
Advanced Text and Tag Operations 548 (2)
Canvas 550 (14)
Basic Canvas Operations 550 (1)
Programming the Canvas Widget 551 (3)
Scrolling Canvases 554 (3)
Scrollable Canvases and Image Thumbnails 557 (3)
Using Canvas Events 560 (4)
Grids 564 (18)
Why Grids? 564 (1)
Grid Basics: Input Forms Revisited 565 (1)
Comparing grid and pack 566 (2)
Combining grid and pack 568 (2)
Making Gridded Widgets Expandable 570 (4)
Laying Out Larger Tables with grid 574 (8)
Time Tools, Threads, and Animation 582 (13)
Using Threads with tkinter GUIs 584 (1)
Using the after Method 585 (3)
Simple Animation Techniques 588 (5)
Other Animation Topics 593 (2)
The End of the Tour 595 (2)
Other Widgets and Options 595 (2)
10 GUI Coding Techniques 597 (74)
"Building a Better Mousetrap" 597 (1)
GuiMixin: Common Tool Mixin Classes 598 (5)
Widget Builder Functions 598 (1)
Mixin Utility Classes 599 (4)
GuiMaker: Automating Menus and Toolbars 603 (10)
Subclass Protocols 607 (1)
GuiMaker Classes 608 (1)
GuiMaker Self-Test 608 (1)
BigGui: A Client Demo Program 609 (4)
ShellGui: GUIs for Command-Line Tools 613 (10)
A Generic Shell-Tools Display 613 (2)
Application-Specific Tool Set Classes 615 (2)
Adding GUI Frontends to Command Lines 617 (6)
GuiStreams: Redirecting Streams to Widgets 623 (5)
Using Redirection for the Packing 627 (1)
Scripts
Reloading Callback Handlers Dynamically 628 (2)
Wrapping Up Top-Level Window Interfaces 630 (5)
GUIs, Threads, and Queues 635 (11)
Placing Data on Queues 636 (4)
Placing Callbacks on Queues 640 (6)
More Ways to Add GUIs to Non-GUI Code 646 (16)
Popping Up GUI Windows on Demand 647 (2)
Adding a GUI As a Separate Program: 649 (5)
Sockets (A Second Look)
Adding a GUI As a Separate Program: 654 (8)
Command Pipes
The PyDemos and PyGadgets Launchers 662 (9)
PyDemos Launcher Bar (Mostly External) 662 (5)
PyGadgets Launcher Bar 667 (4)
11 Complete GUI Programs 671 (100)
"Python, Open Source, and Camaros" 671 (3)
Examples in Other Chapters 672 (1)
This Chapter's Strategy 673 (1)
PyEdit: A Text Editor Program/Object 674 (42)
Running PyEdit 675 (7)
PyEdit Changes in Version 2.0 (Third 682 (2)
Edition)
PyEdit Changes in Version 2.1 (Fourth 684 (9)
Edition)
PyEdit Source Code 693 (23)
PyPhoto: An Image Viewer and Resizer 716 (11)
Running PyPhoto 717 (2)
PyPhoto Source Code 719 (8)
PyView: An Image and Notes Slideshow 727 (11)
Running PyView 727 (5)
PyView Source Code 732 (6)
PyDraw: Painting and Moving Graphics 738 (9)
Running PyDraw 738 (1)
PyDraw Source Code 738 (9)
PyClock: An Analog/Digital Clock Widget 747 (15)
A Quick Geometry Lesson 747 (4)
Running PyClock 751 (3)
PyClock Source Code 754 (8)
PyToe: A Tic-Tac-Toe Game Widget 762 (4)
Running PyToe 762 (1)
PyToe Source Code (External) 763 (3)
Where to Go from Here 766 (5)
Part IV Internet Programming
12 Network Scripting 771 (82)
"Tune In, Log On, and Drop Out" 771 (6)
Internet Scripting Topics 772 (3)
Running Examples in This Part of the 775 (2)
Book
Python Internet Development Options 777 (3)
Plumbing the Internet 780 (7)
The Socket Layer 781 (1)
The Protocol Layer 782 (3)
Python's Internet Library Modules 785 (2)
Socket Programming 787 (15)
Socket Basics 788 (6)
Running Socket Programs Locally 794 (1)
Running Socket Programs Remotely 795 (3)
Spawning Clients in Parallel 798 (3)
Talking to Reserved Ports 801 (1)
Handling Multiple Clients 802 (25)
Forking Servers 803 (12)
Threading Servers 815 (3)
Standard Library Server Classes 818 (2)
Multiplexing Servers with select 820 (6)
Summary: Choosing a Server Scheme 826 (1)
Making Sockets Look Like Files and Streams 827 (13)
A Stream Redirection Utility 828 (12)
A Simple Python File Server 840 (13)
Running the File Server and Clients 842 (1)
Adding a User-Interface Frontend 843 (10)
13 Client-Side Scripting 853 (152)
"Socket to Me!" 853 (1)
FTP: Transferring Files over the Net 854 (1)
Transferring Files with ftplib 854 (20)
Using urllib to Download Files 857 (3)
FTP get and put Utilities 860 (7)
Adding a User Interface 867 (7)
Transferring Directories with ftplib 874 (18)
Downloading Site Directories 874 (6)
Uploading Site Directories 880 (4)
Refactoring Uploads and Downloads for 884 (8)
Reuse
Transferring Directory Trees with ftplib 892 (7)
Uploading Local Trees 893 (2)
Deleting Remote Trees 895 (4)
Downloading Remote Trees 899 (1)
Processing Internet Email 899 (2)
Unicode in Python 3.X and Email Tools 900 (1)
POP: Fetching Email 901 (9)
Mail Configuration Module 902 (3)
POP Mail Reader Script 905 (1)
Fetching Messages 906 (3)
Fetching Email at the Interactive Prompt 909 (1)
SMTP: Sending Email 910 (11)
SMTP Mail Sender Script 911 (2)
Sending Messages 913 (6)
Sending Email at the Interactive Prompt 919 (2)
email: Parsing and Composing Mail Content 921 (26)
Message Objects 922 (2)
Basic email Package Interfaces in Action 924 (2)
Unicode, Internationalization, and the 926 (21)
Python 3.1 email Package
A Console-Based Email Client 947 (9)
Running the pymail Console Client 952 (4)
The mailtools Utility Package 956 (35)
Initialization File 957 (1)
MailTool Class 958 (1)
MailSender Class 959 (8)
MailFetcher Class 967 (9)
MailParser Class 976 (7)
Self-Test Script 983 (3)
Updating the pymail Console Client 986 (5)
NNTP: Accessing Newsgroups 991 (3)
HTTP: Accessing Websites 994 (3)
The urllib Package Revisited 997 (5)
Other urllib Interfaces 999 (3)
Other Client-Side Scripting Options 1002 (3)
14 The PyMailGUI Client 1005 (120)
"Use the Source, Luke" 1005 (6)
Source Code Modules and Size 1006 (2)
Why PyMailGUI? 1008 (2)
Running PyMailGUI 1010 (1)
Presentation Strategy 1010 (1)
Major PyMailGUI Changes 1011 (8)
New in Version 2.1 and 2.0 (Third 1011 (1)
Edition)
New in Version 3.0 (Fourth Edition) 1012 (7)
A PyMailGUI Demo 1019 (43)
Getting Started 1020 (5)
Loading Mail 1025 (2)
Threading Model 1027 (3)
Load Server Interface 1030 (1)
Offline Processing with Save and Open 1031 (2)
Sending Email and Attachments 1033 (4)
Viewing Email and Attachments 1037 (6)
Email Replies and Forwards and 1043 (6)
Recipient Options
Deleting Email 1049 (2)
POP Message Numbers and Synchronization 1051 (2)
Handling HTML Content in Email 1053 (2)
Mail Content Internationalization 1055 (4)
Support
Alternative Configurations and Accounts 1059 (1)
Multiple Windows and Status Messages 1060 (2)
PyMailGUI Implementation 1062 (54)
PyMailGUI: The Main Module 1063 (3)
SharedNames: Program-Wide Globals 1066 (1)
ListWindows: Message List Windows 1067 (18)
ViewWindows: Message View Windows 1085 (10)
messagecache: Message Cache Manager 1095 (3)
popuputil: General-Purpose GUI Pop Ups 1098 (2)
wraplines: Line Split Tools 1100 (2)
html2text: Extracting Text from HTML 1102 (3)
(Prototype, Preview)
mailconfig: User Configurations 1105 (5)
textConfig: Customizing Pop-Up PyEdit 1110 (1)
Windows
PyMailGUIHelp: User Help Text and 1111 (3)
Display
altconfigs: Configuring for Multiple 1114 (2)
Accounts
Ideas for Improvement 1116 (9)
15 Server-Side Scripting 1125 (104)
"Oh, What a Tangled Web We Weave" 1125 (1)
What's a Server-Side CGI Script? 1126 (4)
The Script Behind the Curtain 1126 (2)
Writing CGI Scripts in Python 1128 (2)
Running Server-Side Examples 1130 (5)
Web Server Options 1130 (1)
Running a Local Web Server 1131 (2)
The Server-Side Examples Root Page 1133 (1)
Viewing Server-Side Examples and Output 1134 (1)
Climbing the CGI Learning Curve 1135 (39)
A First Web Page 1135 (6)
A First CGI Script 1141 (5)
Adding Pictures and Generating Tables 1146 (3)
Adding User Interaction 1149 (8)
Using Tables to Lay Out Forms 1157 (6)
Adding Common Input Devices 1163 (3)
Changing Input Layouts 1166 (4)
Passing Parameters in Hardcoded URLs 1170 (2)
Passing Parameters in Hidden Form Fields 1172 (2)
Saving State Information in CGI Scripts 1174 (9)
URL Query Parameters 1176 (1)
Hidden Form Input Fields 1176 (1)
HTTP "Cookies" 1177 (4)
Server-Side Databases 1181 (1)
Extensions to the CGI Model 1182 (1)
Combining Techniques 1183 (1)
The Hello World Selector 1183 (9)
Checking for Missing and Invalid Inputs 1190 (2)
Refactoring Code for Maintainability 1192 (9)
Step 1 Sharing Objects Between 1193 (3)
Pages---A New Input Form
Step 2 A Reusable Form Mock-Up Utility 1196 (3)
Step 3 Putting It All Together---A New 1199 (2)
Reply Script
More on HTML and URL Escapes 1201 (8)
URL Escape Code Conventions 1202 (1)
Python HTML and URL Escape Tools 1203 (1)
Escaping HTML Code 1203 (1)
Escaping URLs 1204 (1)
Escaping URLs Embedded in HTML Code 1205 (4)
Transferring Files to Clients and Servers 1209 (20)
Displaying Arbitrary Server Files on 1211 (7)
the Client
Uploading Client Files to the Server 1218 (9)
More Than One Way to Push Bits over the 1227 (2)
Net
16 The PyMailCGI Server 1229 (74)
"Things to Do When Visiting Chicago" 1229 (1)
The PyMailCGI Website 1230 (9)
Implementation Overview 1230 (3)
New in This Fourth Edition (Version 3.0) 1233 (2)
New in the Prior Edition (Version 2.0) 1235 (1)
Presentation Overview 1236 (1)
Running This Chapter's Examples 1237 (2)
The Root Page 1239 (2)
Configuring PyMailCGI 1240 (1)
Sending Mail by SMTP 1241 (8)
The Message Composition Page 1242 (1)
The Send Mail Script 1242 (4)
Error Pages 1246 (1)
Common Look-and-Feel 1246 (1)
Using the Send Mail Script Outside a 1247 (2)
Browser
Reading POP Email 1249 (17)
The POP Password Page 1250 (1)
The Mail Selection List Page 1251 (3)
Passing State Information in URL Link 1254 (3)
Parameters
Security Protocols 1257 (2)
The Message View Page 1259 (3)
Passing State Information in HTML 1262 (2)
Hidden Input Fields
Escaping Mail Text and Passwords in HTML 1264 (2)
Processing Fetched Mail 1266 (10)
Reply and Forward 1267 (1)
Delete 1268 (4)
Deletions and POP Message Numbers 1272 (4)
Utility Modules 1276 (15)
External Components and Configuration 1276 (1)
POP Mail Interface 1277 (1)
POP Password Encryption 1278 (8)
Common Utilities Module 1286 (5)
Web Scripting Trade-Offs 1291 (12)
PyMailCGI Versus PyMailGUI 1292 (1)
The Web Versus the Desktop 1293 (3)
Other Approaches 1296 (7)
Part V Tools and Techniques
17 Databases and Persistence 1303 (56)
"Give Me an Order of Persistence, but 1303 (1)
Hold the Pickles"
Persistence Options in Python 1303 (2)
DBM Files 1305 (4)
Using DBM Files 1305 (3)
DBM Details: Files, Portability, and 1308 (1)
Close
Pickled Objects 1309 (6)
Using Object Pickling 1310 (1)
Pickling in Action 1311 (3)
Pickle Details: Protocols, Binary 1314 (1)
Modes, and _pickle
Shelve Files 1315 (10)
Using Shelves 1316 (1)
Storing Built-in Object Types in Shelves 1317 (1)
Storing Class Instances in Shelves 1318 (2)
Changing Classes of Objects Stored in 1320 (1)
Shelves
Shelve Constraints 1321 (2)
Pickled Class Constraints 1323 (1)
Other Shelve Limitations 1324 (1)
The ZODB Object-Oriented Database 1325 (4)
The Mostly Missing ZODB Tutorial 1326 (3)
SQL Database Interfaces 1329 (25)
SQL Interface Overview 1330 (2)
An SQL Database API Tutorial with SQLite 1332 (7)
Building Record Dictionaries 1339 (3)
Tying the Pieces Together 1342 (2)
Loading Database Tables from Files 1344 (3)
SQL Utility Scripts 1347 (7)
SQL Resources 1354 (1)
ORMs: Object Relational Mappers 1354 (2)
PyForm: A Persistent Object Viewer 1356 (3)
(External)
18 Data Structures 1359 (46)
"Roses Are Red, Violets Are Blue; Lists 1359 (1)
Are Mutable, and So Is Set Foo"
Implementing Stacks 1360 (13)
Built-in Options 1360 (2)
A Stack Module 1362 (2)
A Stack Class 1364 (2)
Customization: Performance Monitors 1366 (1)
Optimization: Tuple Tree Stacks 1367 (2)
Optimization: In-Place List 1369 (2)
Modifications
Timing the Improvements 1371 (2)
Implementing Sets 1373 (10)
Built-in Options 1374 (1)
Set Functions 1375 (2)
Set Classes 1377 (1)
Optimization: Moving Sets to 1378 (4)
Dictionaries
Adding Relational Algebra to Sets 1382 (1)
(External)
Subclassing Built-in Types 1383 (2)
Binary Search Trees 1385 (5)
Built-in Options 1385 (1)
Implementing Binary Trees 1386 (2)
Trees with Both Keys and Values 1388 (2)
Graph Searching 1390 (5)
Implementing Graph Search 1390 (3)
Moving Graphs to Classes 1393 (2)
Permuting Sequences 1395 (2)
Reversing and Sorting Sequences 1397 (5)
Implementing Reversals 1398 (1)
Implementing Sorts 1399 (1)
Data Structures Versus Built-ins: The 1400 (2)
Conclusion
PyTree: A Generic Tree Object Viewer 1402 (3)
19 Text and Language 1405 (78)
"See Jack Hack. Hack, Jack, Hack" 1405 (1)
Strategies for Processing Text in Python 1405 (1)
String Method Utilities 1406 (9)
Templating with Replacements and Formats 1408 (1)
Parsing with Splits and Joins 1409 (1)
Summing Columns in a File 1410 (2)
Parsing and Unparsing Rule Strings 1412 (3)
Regular Expression Pattern Matching 1415 (14)
The re Module 1416 (1)
First Examples 1416 (2)
String Operations Versus Patterns 1418 (3)
Using the re Module 1421 (4)
More Pattern Examples 1425 (2)
Scanning C Header Files for Patterns 1427 (2)
XML and HTML Parsing 1429 (9)
XML Parsing in Action 1430 (5)
HTML Parsing in Action 1435 (3)
Advanced Language Tools 1438 (2)
Custom Language Parsers 1440 (17)
The Expression Grammar 1440 (1)
The Parser's Code 1441 (8)
Adding a Parse Tree Interpreter 1449 (5)
Parse Tree Structure 1454 (2)
Exploring Parse Trees with the PyTree 1456 (1)
GUI
Parsers Versus Python 1457 (1)
PyCalc: A Calculator Program/Object 1457 (26)
A Simple Calculator GUI 1458 (5)
PyCalc---A "Real" Calculator GUI 1463 (20)
20 Python/C Integration 1483 (60)
"I Am Lost at C" 1483 (3)
Extending and Embedding 1484 (2)
Extending Python in C: Overview 1486 (1)
A Simple C Extension Module 1487 (4)
The SWIG Integration Code Generator 1491 (4)
A Simple SWIG Example 1491 (4)
Wrapping C Environment Calls 1495 (7)
Adding Wrapper Classes to Flat Libraries 1499 (1)
Wrapping C Environment Calls with SWIG 1500 (2)
Wrapping C++ Classes with SWIG 1502 (9)
A Simple C++ Extension Class 1503 (2)
Wrapping the C++ Class with SWIG 1505 (2)
Using the C++ Class in Python 1507 (4)
Other Extending Tools 1511 (3)
Embedding Python in C: Overview 1514 (4)
The C Embedding API 1515 (1)
What Is Embedded Code? 1516 (2)
Basic Embedding Techniques 1518 (12)
Running Simple Code Strings 1519 (3)
Running Code Strings with Results and 1522 (2)
Namespaces
Calling Python Objects 1524 (2)
Running Strings in Dictionaries 1526 (2)
Precompiling Strings to Bytecode 1528 (2)
Registering Callback Handler Objects 1530 (5)
Registration Implementation 1531 (4)
Using Python Classes in C 1535 (3)
Other Integration Topics 1538 (5)
Part VI The End
21 Conclusion: Python and the Development 1543 (14)
Cycle
"That's the End of the Book, Now Here's 1544 (1)
the Meaning of Life"
"Something's Wrong with the Way We 1544 (1)
Program Computers"
The "Gilligan Factor" 1544 (1)
Doing the Right Thing 1545 (2)
The Static Language Build Cycle 1546 (1)
Artificial Complexities 1546 (1)
One Language Does Not Fit All 1546 (1)
Enter Python 1547 (1)
But What About That Bottleneck? 1548 (4)
Python Provides Immediate Turnaround 1549 (1)
Python Is "Executable Pseudocode" 1550 (1)
Python Is OOP Done Right 1550 (1)
Python Fosters Hybrid Applications 1551 (1)
On Sinking the Titanic 1552 (3)
So What's "Python: The Sequel"? 1555 (1)
In the Final Analysis... 1555 (2)
Index 1557