Log In
Join
for free
Back To Course Home
Python 3: An interactive deep dive
0% completed
Your First Python Program
Diving In
Declaring Functions
Writing Readable Code
The import Search Path
Everything Is An Object
Indenting Code
Exceptions
Unbound Variables
Everything is Case-Sensitive
Running Scripts
Further Reading
Native Datatypes
Diving In
Booleans
Numbers
Lists
Tuples
Sets
Dictionaries
None
Further Reading
Comprehensions
Diving In
Working With Files And Directories
List Comprehensions
Dictionary Comprehensions
Set Comprehensions
Further Reading
Strings
Some Boring Stuff You Need To Understand Before You Can Dive In
Unicode
Diving In
Formatting Strings
Other Common String Methods
Strings vs. Bytes
Postscript: Character Encoding Of Python Source Code
Further Reading
Regular Expressions
Diving In
Case Study: Street Addresses
Case Study: Roman Numerals
Using The {n,m} Syntax
Verbose Regular Expressions
Case study: Parsing Phone Numbers
Summary
Closures & Generators
Diving In
I Know, Let’s Use Regular Expressions!
A List Of Functions
A List Of Patterns
A File Of Patterns
Generators
Further Reading
Classes & Iterators
Diving In
Defining Classes
Instantiating Classes
Instance Variables
A Fibonacci Iterator
A Plural Rule Iterator
Further Reading
Advanced Iterators
Diving In
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
Unit Testing
(Not) Diving In
A Single Question
“Halt And Catch Fire”
More Halting, More Fire
And One More Thing…
A Pleasing Symmetry
More Bad Input
Refactoring
Diving In
Handling Changing Requirements
Refactoring
Summary
Files
Diving In
Reading From Text Files
Writing to Text Files
Binary Files
Stream Objects From Non-File Sources
Standard Input, Output, and Error
Further Reading
XML
Diving In
A 5-Minute Crash Course in XML
The Structure Of An Atom Feed
Parsing XML
Searching For Nodes Within An XML Document
Going Further With lxml
Generating XML
Parsing Broken XM
Further Reading
Serializing Python Objects
Diving In
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 of Python Datatypes to JSON
Serializing Datatypes Unsupported by JSON
Loading Data from a JSON File
Further Reading
HTTP Web Services
Diving In
Features of HTTP
How Not To Fetch Data Over HTTP
What’s On The Wire?
Introducing httplib2
Beyond HTTP GET
Beyond HTTP POST
Further Reading
Case Study: Porting chardet to Python 3
Diving In
What is Character Encoding Auto-Detection?
Introducing The chardet Module
Running 2to3
A Short Digression Into Multi-File Modules
Fixing What 2to3 Can’t
Summary
Packaging Python Libraries
Diving In
Things Distutils Can’t Do For You
Directory Structure
Writing Your Setup Script
Classifying Your Package
Specifying Additional Files With A Manifest
Checking Your Setup Script for Errors
Creating a Source Distribution
Creating a Graphical Installer
Adding Your Software to The Python Package Index
The Many Possible Futures of Python Packaging
Further Reading
Appendix : Where To Go From Here
Things to Read
Where To Look For Python 3-Compatible Code
License
Further Reading
Iterator types
PEP 234: Iterators
PEP 255: Simple Generators
Generator Tricks for Systems Programmers
Get hands-on with 1400+ tech skills courses.
Start Free Trial