Python phrasebook: essential code and commands
โ Scribed by Dayley, Brad
- Publisher
- Sams Publishing
- Year
- 2006;2009
- Tongue
- English
- Leaves
- 289
- Series
- Developer's library
- Edition
- 5. print
- Category
- Library
No coin nor oath required. For personal study only.
โฆ Synopsis
Python Phrasebook Brad Dayley Essential Code and CommandsPython Phrasebookgives you the code phrases you need to quickly and effectively complete your programming projects in Python. Concise and Accessible Easy to carry and easy to use-lets you ditch all those bulky books for one portable guide Flexible and Functional Packed with more than 100 customizable code snippets-so you can readily code functional Python in just about any situation Brad Dayley is a software engineer at Novell, Inc. He has been a system administrator and software developer on the Unix, Windows, Linux, and NetWare platforms for the past 14 years. Brad co-developed an advanced debugging course used to train engineers and customers and is the co-author of several Novell Press books. Programming / Python
โฆ Table of Contents
Cover......Page 1
Contents......Page 4
Introduction......Page 12
Why Use Python?......Page 14
Invoking the Interpreter......Page 15
Built-In Types......Page 16
Understanding Python Syntax......Page 21
Python Objects, Modules, Classes, and Functions......Page 27
Error Handling......Page 39
Using System Tools......Page 41
Comparing Strings......Page 48
Joining Strings......Page 50
Splitting Strings......Page 52
Searching Strings for Substrings......Page 53
Search and Replace in Strings......Page 54
Searching Strings for Specific Endings/Beginnings......Page 55
Trimming Strings......Page 57
Aligning/Formatting Strings......Page 58
Executing Code Inside Strings......Page 60
Interpolating Variables Inside Strings......Page 61
Converting Unicode to Local Strings......Page 63
3 Managing Data Types......Page 66
Defining a List......Page 67
Accessing a List......Page 68
Slicing a List......Page 70
Adding and Removing Items in a List......Page 72
Sorting a List......Page 74
Using Tuples......Page 77
Constructing a Dictionary......Page 79
Adding a Value to a Dictionary......Page 80
Retrieving a Value from a Dictionary......Page 82
Slicing a Dictionary......Page 84
Swapping Keys for Values in a Dictionary......Page 86
Opening and Closing Files......Page 88
Reading an Entire File......Page 91
Reading a Single Line from a File......Page 93
Accessing Each Word in a File......Page 94
Writing a File......Page 95
Determining the Number of Lines in a File......Page 97
Walking the Directory Tree......Page 98
Renaming Files......Page 99
Recursively Deleting Files and Subdirectories......Page 101
Searching for Files Based on Extension......Page 103
Creating a TAR File......Page 105
Extracting a File from a TAR......Page 108
Adding Files to a ZIP File......Page 109
Retrieving Files from a ZIP File......Page 111
5 Managing Threads......Page 114
Starting a New Thread......Page 115
Creating and Exiting Threads......Page 117
Synchronizing Threads......Page 119
Implementing a Multithreaded Priority Queue......Page 121
Initiating a Timer-Interrupted Thread......Page 124
6 Managing Databases......Page 128
Adding Entries to a DBM File......Page 129
Retrieving Entries from a DBM File......Page 131
Updating Entries in a DBM File......Page 133
Pickling Objects to a File......Page 135
Unpickling Objects from a File......Page 137
Storing Objects in a Shelve File......Page 139
Retrieving Objects from a Shelve File......Page 142
Changing Objects in a Shelve File......Page 144
Connecting to a MySQL Database Server......Page 146
Creating a MySQL Database......Page 149
Adding Entries to a MySQL Database......Page 151
Retrieving Entries from a MySQL Database......Page 153
Opening a Server-Side Socket for Receiving Data......Page 156
Opening a Client-Side Socket for Sending Data......Page 160
Receiving Streaming Data Using the ServerSocket Module......Page 162
Sending Streaming Data......Page 164
Sending Email Using SMTP......Page 165
Retrieving Email from a POP3 Server......Page 168
Using Python to Fetch Files from an FTP Server......Page 170
8 Processing HTML......Page 174
Parsing URLs......Page 175
Opening HTML Documents......Page 178
Retrieving Links from HTML Documents......Page 180
Retrieving Images from HTML Documents......Page 182
Retrieving Text from HTML Documents......Page 185
Retrieving Cookies in HTML Documents......Page 187
Adding Quotes to Attribute Values in HTML Documents......Page 190
9 Processing XML......Page 196
Loading an XML Document......Page 197
Checking for Well-Formed XML Documents......Page 199
Accessing Child Nodes......Page 201
Accessing Element Attributes......Page 205
Adding a Node to a DOM Tree......Page 207
Removing a Node from a DOM Tree......Page 210
Searching XML Documents......Page 213
Extracting Text from XML Documents......Page 216
Parsing XML Tags......Page 219
10 Programming Web Services......Page 222
Adding HTML to Web Pages Using CGI Scripts......Page 223
Processing Parameters Passed to CGI Scripts......Page 225
Creating Self-Posting CGI Scripts......Page 228
Allowing Users to Upload Files via CGI Scripts......Page 232
Creating an HTTP Server to Handle GET Requests......Page 235
Creating an HTTP Server to Handle POST Requests......Page 239
Creating an HTTP Server to Process CGI Scripts......Page 244
Sending an HTTP GET Request from a Python Script......Page 246
Sending an HTTP POST Request from a Python Script......Page 249
Creating an XML-RPC Server......Page 252
Creating an XML-RPC Client......Page 254
Using SOAPpy to Access SOAP Web Services Through a WSDL File......Page 256
A......Page 260
C......Page 261
D......Page 263
E......Page 265
F......Page 266
G......Page 267
H......Page 268
J......Page 269
M......Page 270
O......Page 275
P......Page 276
R......Page 277
S......Page 278
T......Page 282
U......Page 283
W......Page 284
X-Y......Page 285
Z......Page 286
โฆ Subjects
Computer Science;Programming;Reference;Science;Software;Technical;Computers
๐ SIMILAR VOLUMES
Python Phrasebook Brad Dayley Essential Code and Commands<i></i><i>Python Phrasebook</i>gives you the code phrases you need to quickly and effectively complete your programming projects in Python. Concise and Accessible Easy to carry and easy to use-lets you ditch all those bulky books for one porta
Python Phrasebook gives you the code phrases you need to quickly and effectively complete your programming projects in Python.Concise and AccessibleEasy to carry and easy to uselets you ditch all those bulky books for one portable guideFlexible and FunctionalPacked with more than 100 customizable co
Developers are hungry for a concise, easy-to-use reference that puts essential code "phrases" at their fingertips. JavaScript, and the related AJAX, is hot and there is little to no information on how to use JavaScript to develop AJAX-based applications. While there are many JavaScript books on the
1 online resource (xv, 222 pages)
Developers are hungry for a concise, easy-to-use reference that puts essential code "phrases" at their fingertips. JavaScript, and the related AJAX, is hot and there is little to no information on how to use JavaScript to develop AJAX-based applications. While there are many JavaScript books on the