Dive Into Python 3 Books for Professionals by Professionals 2nd Edition by Mark Pilgrim – Ebook PDF Instant Download/Delivery: 1430224150, 9781430224150
Full download Dive Into Python 3 Books for Professionals by Professionals 2nd Edition after payment
Product details:
ISBN 10: 1430224150
ISBN 13: 9781430224150
Author: Mark Pilgrim
Mark Pilgrim’s Dive Into Python 3 is a hands-on guide to Python 3 and its differences from Python 2. As in the original book, Dive Into Python, each chapter starts with a real, complete code sample, proceeds to pick it apart and explain the pieces, and then puts it all back together in a summary at the end. This book includes: Example programs completely rewritten to illustrate powerful new concepts now available in Python 3: sets, iterators, generators, closures, comprehensions, and much more A detailed case study of porting a major library from Python 2 to Python 3 A comprehensive appendix of all the syntactic and semantic changes in Python 3 This is the perfect resource for you if you need to port applications to Python 3, or if you like to jump into languages fast and get going right away.
Dive Into Python 3 Books for Professionals by Professionals 2nd Table of contents:
CHAPTER 1 Your First Python Program
Declaring Functions
Optional and Named Arguments
Writing Readable Code
Documentation Strings
The import Search Path
Everything Is an Object
What’s an Object?
Indenting Code
Exceptions
Catching Import Errors
Unbound Variables
Running Scripts
Further Reading Online
CHAPTER 2 Native Datatypes
Booleans
Numbers
Coercing Integers to Floats and Vice Versa
Common Numerical Operations
Fractions
Trigonometry
Numbers in a Boolean Context
Lists
Creating a List
Slicing a List
Adding Items to a List
Searching For Values in a List
Removing Items from a List
Removing Items from a List: Bonus Round
Lists in a Boolean Context
Tuples
Tuples in a Boolean Context
Assigning Multiple Values at Once
Sets
Modifying a Set
Removing Items from a Set
Common Set Operations
Sets in a Boolean Context
Dictionaries
Creating a Dictionary
Modifying a Dictionary
Mixed-Value Dictionaries
Dictionaries in a Boolean Context
None
None in a Boolean Context
Further Reading Online
CHAPTER 3 Comprehensions
Working With Files and Directories
The Current Working Directory
Working with Filenames and Directory Names
Listing Directories
Getting File Metadata
Constructing Absolute Pathnames
List Comprehensions
Dictionary Comprehensions
Fun with Dictionary Comprehensions
Set Comprehensions
Further Reading Online
CHAPTER 4 Strings
Unicode
Diving In
Formatting Strings
Compound Field Names
Format Specifiers
Other Common String Methods
Slicing a String
Strings versus Bytes
Character Encoding of Python Source Code
Further Reading Online
CHAPTER 5 Regular Expressions
Case Study: Street Addresses
Case Study: Roman Numerals
Checking for Thousands
Checking for Hundreds
Using the {n,m} Syntax
Checking for Tens and Ones
Verbose Regular Expressions
Case Study: Parsing Phone Numbers
Further Reading Online
CHAPTER 6 Closures and Generators
I Know, Let’s Use Regular Expressions!
A List of Functions
A List of Patterns
A File of Patterns
Generators
A Fibonacci Generator
A Plural Rule Generator
Further Reading Online
CHAPTER 7 Classes and Iterators
Defining Classes
The init() Method
Instantiating Classes
Instance Variables
A Fibonacci Iterator
A Plural Rule Iterator
Further Reading Online
CHAPTER 8 Advanced Iterators
Finding All Occurrences of a Pattern
Finding the Unique Items in a Sequence
Making Assertions
Generator Expressions
Calculating Permutations … the Lazy Way
Other Fun Stuff in the itertools Module
A New Kind of String Manipulation
Evaluating Arbitrary Strings as Python Expressions
Putting It All Together
Further Reading Online
CHAPTER 9 Unit Testing
A Single Question
Halt and Catch Fire
More Halting, More Fire
And One More Thing …
A Pleasing Symmetry
More Bad Input
CHAPTER 10 Refactoring
Handling Changing Requirements
Refactoring
Further Reading Online
CHAPTER 11 Files
Reading from Text Files
Character Encoding Rears Its Ugly Head
Stream Objects
Reading Data from a Text File
Closing Files
Closing Files Automatically
Reading Data One Line at a Time
Writing to Text Files
Character Encoding Again
Binary Files
Streams Objects from Nonfile Sources
Handling Compressed Files
Standard Input, Output, and Error
Redirecting Standard Output
Further Reading Online
CHAPTER 12 XML
A 5-Minute Crash Course in XML
The Structure of an Atom Feed
Parsing XML
Elements Are Lists
Attributes Are Dictionaries
Searching for Nodes Within an XML Document
Going Further with lxml
Generating XML
Parsing Broken XML
Further Reading Online
CHAPTER 13 Serializing Python Objects
A Quick Note About the Examples in this Chapter
Saving Data to a Pickle File
Loading Data from a Pickle File
Pickling Without a File
Bytes and Strings Rear Their Ugly Heads Again
Debugging Pickle Files
Serializing Python Objects to be Read by Other Languages
Saving Data to a JSON File
Mapping Python Datatypes to JSON
Serializing Datatypes Unsupported by JSON
Loading Data from a JSON File
Further Reading Online
CHAPTER 14 HTTP Web Services
Features of HTTP
Caching
Last-Modified Checking
ETags
Compression
Redirects
How Not to Fetch Data Over HTTP
What’s On the Wire?
Introducing httplib2
Caching with httplib2
Handling Last-Modified and ETag Headers with httplib2
Handling Compression with httplib2
Handling Redirects with httplib2
Beyond HTTP GET
Beyond HTTP POST
Further Reading Online
CHAPTER 15 Case Study: Porting chardet to Python 3
What Is Character Encoding Auto-Detection?
Why Auto-Detection Is Difficult
Auto-Encoding Algorithms
Introducing the chardet Module
UTF-n with a BOM
Escaped Encodings
Multibyte Encodings
Single-Byte Encodings
windows-1252
Running 2to3
A Short Digression Into Multi-File Modules
Fixing What 2to3 Can’t
False Is Invalid Syntax
No Module Named Constants
Name ‘file’ Is Not Defined
Can’t Use a String Pattern on a Bytes-Like Object
Can’t Convert ‘bytes’ Object to str Implicitly
Unsupported Operand type(s) for +: ‘int’ and ‘bytes’
ord() Expected String of Length 1, but int Found
Unorderable Types: int() >= str()
Global Name ‘reduce’ Is not Defined
Lessons Learned
CHAPTER 16 Packaging Python Libraries
Things Distutils Can’t Do for You
Directory Structure
Writing Your Setup Script
Classifying Your Package
Examples of Good Package Classifiers
Checking Your Setup Script for Errors
Creating a Source Distribution
Creating a Graphical Installer
Building Installable Packages for Other Operating Systems
Adding Your Software to the Python Package Index
The Many Possible Futures of Python Packaging
Further Reading Online
People also search for Dive Into Python 3 Books for Professionals by Professionals 2nd:
dive into python 3 github
dive into python 3
dive into python
dive into python 3 book
Tags: Mark Pilgrim, Python, Professionals, Dive