Table of contents for Python phrasebook : essential code and commands / Brad Dayley.


Bibliographic record and links to related information available from the Library of Congress catalog
Note: Electronic data is machine generated. May be incomplete or contain other coding.


Counter
Introduction                          1
1 Understanding Python                  3
Why Use Python?                      3
Invoking the Interpreter             4
Built-in Types                       5--
Understanding Python Syntax         10
Python Objects, Modules, Classes,
and Functions                      16
Error Handling                      28
Using System Tools                  30
2 Manipulating Strings                 37
Comparing Strings                   37
Joining Strings                     39
Splitting Strings                   41
Searching Strings for Substrings    42
Search and Replace in Strings       43
Searching Strings for Specific
Endings/Beginnings                 44
Trimming Strings                    46
Aligning/Formatting Strings         47
Executing Code Inside Strings       49
Interpolating Variables Inside Strings  50
Converting Unicode to Local Strings  52
3 Managing Data Types                  55
Defining a List                     56
Accessing a List                    57
Slicing a List                      59
Adding and Removing Items in a List  61
Sorting a List                     63
Using Tuples                       66
Constructing a Dictionary          68
Adding a Value to a Dictionary     69
Retrieving a Value from a Dictionary  71
Slicing a Dictionary               73
Swapping Keys for Values in a Dictionary  75
4 Managing Files                       77
Opening and Closing Files          77
Reading an Entire File             80
Reading a Single Line from a File  82
Accessing Each Word in a File      83
Writing a File                     84
Determining the Number of Lines in a File  86
Walking the Directory Tree         87
Renaming Files                     88
Recursively Deleting Files and Subdirectories 90
Searching for Files Based on Extension  92
Creating a TAR File                94
Extracting a File from a TAR File  97
Adding Files to a ZIP File         98
Retrieving Files from a ZIP File  100
5 Managing Threads                    103
Starting a New Thread             104
Creating and Exiting Threads      106
Synchronizing Threads             108
Implementing a Multithreaded Priority Queue  110
Initiating a Timer-Interrupted Thread  113
6 Managing Databases                  117
Adding Entries to a DBM File       118
Retrieving Entries from a DBM File  120
Updating Entries in a DBM File     122
Pickling Objects to a File         124
Unpickling Objects from a File     126
Storing Objects in a Shelve File   128
Retrieving Objects from a Shelve File  131
Changing Objects in a Shelve File  133
Connecting to a MySQL Database Server  135
Creating a MySQL Database          138
Adding Entries to a MySQL Database  f40
Retrieving Entries from a MySQL Database  142
7 Implementing Internet Communication  145
Opening a Server-Side Socket for
Receiving Data                   145
Opening a Client-Side Socket for
Sending Data                     149
Receiving Streaming Data Using the
ServerSocket Module              151
Sending Streaming Data             153
Sending Email Using SMTP           154
Retrieving Email from a POP3 Server  157
Using Python to Fetch Files from an
FTP Server                       159
8 Processing HTML                     163
Parsing URLs                       164
Opening HTML Documents             167
Retrieving Links from HTML Documents  169
Retrieving Images from HTML Documents  171
Retrieving Text from HTML Documents  174
Retrieving Cookies in HTML Documents  176
Adding Quotes to Attribute Values in
HTML Documents                   179
9 Processing XML                      185
Loading an XML Document            186
Checking for Well-Formed XML Documents  188
Accessing Child Nodes              190
Accessing Element Attributes       194
Adding a Node to a DOM Tree        196
Removing a Node from a DOM Tree    199
Searching XML Documents            202
Extracting Text from XML Documents  205
Parsing XML Tags                   208
10 Programming Web Services            211
Adding HTML to Web Pages Using
CGI Scripts                      212
Processing Parameters Passed to
CGI Scripts                      214
Creating Self-Posting CGI Scripts  217
Allowing Users to Upload Files via
CGI Scripts                      221
Creating an HTTP Server to Handle
GET Requests                     224
Creating an HTTP Server to Handle POST
Requests                         228
Creating an HTTP Server to Process
CGI Scripts                      233
Sending an HTTP GET Request from
a Python Script                  235
Sending an HTTP POST Request from
a Python Script                  238
Creating an XML-RPC Server         241
Creating an XML-RPC Client         243
Using SOAPpy to Access SOAP Web
Services Through a WSDL File     245



Library of Congress subject headings for this publication: Python (Computer program language)