معرفی کتاب «Python Phrasebook: Essential Codes and Commands» نوشتهٔ Dayley, Brad، منتشرشده توسط نشر Sams Publishing در سال 2006. این کتاب در 288 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Python Phrasebook: Essential Codes and Commands» در دستهٔ بدون دستهبندی قرار دارد.
Python Phrasebook Brad Dayley Essential Code and Commands__Python Phrasebook__ Cover......Page 1 Python Phrasebook: Essential Code and Commands......Page 2 Table of Contents......Page 3 Copyright......Page 6 Acknowledgments......Page 9 About the Author......Page 10 Introduction......Page 11 Chapter 1. Understanding Python......Page 12 Why Use Python?......Page 13 Invoking the Interpreter......Page 14 Built-In Types......Page 15 Understanding Python Syntax......Page 19 Python Objects, Modules, Classes, and Functions......Page 24 Error Handling......Page 32 Using System Tools......Page 34 Chapter 2. Manipulating Strings......Page 38 Comparing Strings......Page 39 Joining Strings......Page 41 Splitting Strings......Page 43 Searching Strings for Substrings......Page 44 Search and Replace in Strings......Page 46 Searching Strings for Specific Endings/Beginnings......Page 47 Trimming Strings......Page 48 Aligning/Formatting Strings......Page 50 Executing Code Inside Strings......Page 52 Interpolating Variables Inside Strings......Page 53 Converting Unicode to Local Strings......Page 54 Chapter 3. Managing Data Types......Page 56 Defining a List......Page 57 Accessing a List......Page 59 Slicing a List......Page 61 Adding and Removing Items in a List......Page 63 Sorting a List......Page 65 Using Tuples......Page 67 Constructing a Dictionary......Page 69 Adding a Value to a Dictionary......Page 70 Retrieving a Value from a Dictionary......Page 72 Slicing a Dictionary......Page 74 Swapping Keys for Values in a Dictionary......Page 76 Chapter 4. Managing Files......Page 77 Opening and Closing Files......Page 78 Reading an Entire File......Page 80 Reading a Single Line from a File......Page 82 Accessing Each Word in a File......Page 83 Writing a File......Page 84 Determining the Number of Lines in a File......Page 86 Walking the Directory Tree......Page 87 Renaming Files......Page 89 Recursively Deleting Files and Subdirectories......Page 91 Searching for Files Based on Extension......Page 93 Creating a TAR File......Page 95 Extracting a File from a TAR File......Page 97 Adding Files to a ZIP File......Page 99 Retrieving Files from a ZIP File......Page 101 Chapter 5. Managing Threads......Page 103 Starting a New Thread......Page 104 Creating and Exiting Threads......Page 106 Synchronizing Threads......Page 108 Implementing a Multithreaded Priority Queue......Page 110 Initiating a Timer-Interrupted Thread......Page 113 Chapter 6. Managing Databases......Page 115 Adding Entries to a DBM File......Page 116 Retrieving Entries from a DBM File......Page 118 Updating Entries in a DBM File......Page 120 Pickling Objects to a File......Page 122 Unpickling Objects from a File......Page 124 Storing Objects in a Shelve File......Page 126 Retrieving Objects from a Shelve File......Page 128 Changing Objects in a Shelve File......Page 130 Connecting to a MySQL Database Server......Page 132 Creating a MySQL Database......Page 134 Adding Entries to a MySQL Database......Page 136 Retrieving Entries from a MySQL Database......Page 138 Chapter 7. Implementing Internet Communication......Page 140 Opening a Server-Side Socket for Receiving Data......Page 141 Opening a Client-Side Socket for Sending Data......Page 144 Receiving Streaming Data Using the ServerSocket Module......Page 146 Sending Streaming Data......Page 148 Sending Email Using SMTP......Page 150 Retrieving Email from a POP3 Server......Page 152 Using Python to Fetch Files from an FTP Server......Page 154 Chapter 8. Processing HTML......Page 156 Parsing URLs......Page 157 Opening HTML Documents......Page 159 Retrieving Links from HTML Documents......Page 161 Retrieving Images from HTML Documents......Page 163 Retrieving Text from HTML Documents......Page 165 Retrieving Cookies in HTML Documents......Page 167 Adding Quotes to Attribute Values in HTML Documents......Page 169 Chapter 9. Processing XML......Page 172 Loading an XML Document......Page 173 Checking for Well-Formed XML Documents......Page 175 Accessing Child Nodes......Page 177 Accessing Element Attributes......Page 180 Adding a Node to a DOM Tree......Page 182 Removing a Node from a DOM Tree......Page 184 Searching XML Documents......Page 186 Extracting Text from XML Documents......Page 189 Parsing XML Tags......Page 191 Chapter 10. Programming Web Services......Page 193 Adding HTML to Web Pages Using CGI Scripts......Page 194 Processing Parameters Passed to CGI Scripts......Page 196 Creating Self-Posting CGI Scripts......Page 200 Allowing Users to Upload Files via CGI Scripts......Page 203 Creating an HTTP Server to Handle GET Requests......Page 206 Creating an HTTP Server to Handle POST Requests......Page 209 Creating an HTTP Server to Process CGI Scripts......Page 213 Sending an HTTP GET Request from a Python Script......Page 215 Sending an HTTP POST Request from a Python Script......Page 218 Creating an XML-RPC Server......Page 220 Creating an XML-RPC Client......Page 222 Using SOAPpy to Access SOAP Web Services Through a WSDL File......Page 224 Index......Page 227 SYMBOL......Page 228 A......Page 229 B......Page 231 C......Page 232 D......Page 235 E......Page 238 F......Page 240 G......Page 242 H......Page 243 I......Page 245 J......Page 246 K......Page 247 L......Page 248 M......Page 249 N......Page 255 O......Page 256 P......Page 257 Q......Page 259 R......Page 260 S......Page 262 T......Page 267 U......Page 269 V......Page 270 W......Page 271 X......Page 272 Z......Page 273 Python Cover 1 Python Phrasebook: Essential Code and Commands 2 Table of Contents 3 Copyright 6 Acknowledgments 9 About the Author 10 Introduction 11 Chapter 1. Understanding Python 12 Why Use Python? 13 Invoking the Interpreter 14 Built-In Types 15 Understanding Python Syntax 19 Python Objects, Modules, Classes, and Functions 24 Error Handling 32 Using System Tools 34 Chapter 2. Manipulating Strings 38 Comparing Strings 39 Joining Strings 41 Splitting Strings 43 Searching Strings for Substrings 44 Search and Replace in Strings 46 Searching Strings for Specific Endings/Beginnings 47 Trimming Strings 48 Aligning/Formatting Strings 50 Executing Code Inside Strings 52 Interpolating Variables Inside Strings 53 Converting Unicode to Local Strings 54 Chapter 3. Managing Data Types 56 Defining a List 57 Accessing a List 59 Slicing a List 61 Adding and Removing Items in a List 63 Sorting a List 65 Using Tuples 67 Constructing a Dictionary 69 Adding a Value to a Dictionary 70 Retrieving a Value from a Dictionary 72 Slicing a Dictionary 74 Swapping Keys for Values in a Dictionary 76 Chapter 4. Managing Files 77 Opening and Closing Files 78 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 89 Recursively Deleting Files and Subdirectories 91 Searching for Files Based on Extension 93 Creating a TAR File 95 Extracting a File from a TAR File 97 Adding Files to a ZIP File 99 Retrieving Files from a ZIP File 101 Chapter 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 Chapter 6. Managing Databases 115 Adding Entries to a DBM File 116 Retrieving Entries from a DBM File 118 Updating Entries in a DBM File 120 Pickling Objects to a File 122 Unpickling Objects from a File 124 Storing Objects in a Shelve File 126 Retrieving Objects from a Shelve File 128 Changing Objects in a Shelve File 130 Connecting to a MySQL Database Server 132 Creating a MySQL Database 134 Adding Entries to a MySQL Database 136 Retrieving Entries from a MySQL Database 138 Chapter 7. Implementing Internet Communication 140 Opening a Server-Side Socket for Receiving Data 141 Opening a Client-Side Socket for Sending Data 144 Receiving Streaming Data Using the ServerSocket Module 146 Sending Streaming Data 148 Sending Email Using SMTP 150 Retrieving Email from a POP3 Server 152 Using Python to Fetch Files from an FTP Server 154 Chapter 8. Processing HTML 156 Parsing URLs 157 Opening HTML Documents 159 Retrieving Links from HTML Documents 161 Retrieving Images from HTML Documents 163 Retrieving Text from HTML Documents 165 Retrieving Cookies in HTML Documents 167 Adding Quotes to Attribute Values in HTML Documents 169 Chapter 9. Processing XML 172 Loading an XML Document 173 Checking for Well-Formed XML Documents 175 Accessing Child Nodes 177 Accessing Element Attributes 180 Adding a Node to a DOM Tree 182 Removing a Node from a DOM Tree 184 Searching XML Documents 186 Extracting Text from XML Documents 189 Parsing XML Tags 191 Chapter 10. Programming Web Services 193 Adding HTML to Web Pages Using CGI Scripts 194 Processing Parameters Passed to CGI Scripts 196 Creating Self-Posting CGI Scripts 200 Allowing Users to Upload Files via CGI Scripts 203 Creating an HTTP Server to Handle GET Requests 206 Creating an HTTP Server to Handle POST Requests 209 Creating an HTTP Server to Process CGI Scripts 213 Sending an HTTP GET Request from a Python Script 215 Sending an HTTP POST Request from a Python Script 218 Creating an XML-RPC Server 220 Creating an XML-RPC Client 222 Using SOAPpy to Access SOAP Web Services Through a WSDL File 224 Index 227 SYMBOL 228 A 229 B 231 C 232 D 235 E 238 F 240 G 242 H 243 I 245 J 246 K 247 L 248 M 249 N 255 O 256 P 257 Q 259 R 260 S 262 T 267 U 269 V 270 W 271 X 272 Z 273 # Paperback: 288 pages # Publisher: Sams (November 6,2006) # Language: English # ISBN-10: 0672329107 # ISBN-13: 978-0672329104
Python Phrasebook
Brad Dayley
Essential Code and Commands
Python Phrasebook 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 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
Python Phrasebook Brad Dayley Essential Code and Commands Python Phrasebook 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 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, Incorporated 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