Python 201: Intermediate Python
阿新 • • 發佈:2018-12-29
Python 201 is the sequel to my first book, Python 101. If you already know the basics of Python and now you want to go to the next level, then this is the book for you! This book is for intermediate level Python programmers only. There won’t be any beginner chapters here. This book is based on Python 3
Cover art by Varya Kolesnikova. You can view more of her art on Behance or Instagram.
Purchase the book:
Table of Contents
-
- About the Author
- Conventions
- Requirements
- Reader Feedback
- Errata
- Code Examples
-
- Getting Started
- Adding Arguments
- Short Options and Long Options
- Options that Conflict
- Wrapping Up
-
- ChainMap
- Counter
- defaultdict
- deque
- namedtuple
- OrderedDict
- Wrapping Up
-
- Creating a Context Manager class
- Creating a Context Manager using contextlib
- contextlib.closing(thing)
- contextlib.suppress(*exceptions)
- contextlib.redirect_stdout / redirect_stderr
- ExitStack
- Reentrant Context Managers
- Wrapping Up
-
- Caching with functools.lru_cache
- functool.partial
- Function Overloading with functools.singledispatch
- functools.wraps
- Wraps to the Rescue!
- Wrapping Up
-
- Regular Imports
- Using “from module import something”
- Relative Imports
- Optional Imports
- Local Imports
- Import Pitfalls
- Wrapping Up
-
- Dynamic Imports
- Module Import Checking
- Import From Source File
- import_from_github_com
- Wrapping Up
-
- Iterators
- Creating Your Own Iterators
- Generators
- Wrapping Up
-
- The Infinite Iterators
- Iterators That Terminate
- The Combinatoric Generators
- Wrapping Up
-
- The Matching Characters
- Pattern Matching Using search
- Escape Codes
- Compiling
- Compilation Flags
- Finding Multiple Instances
- Backslashes Are Complicated
- Wrapping Up
-
- Type Hints and Overloaded Functions
- Wrapping Up
-
- any
- enumerate
- eval
- filter
- map
- zip
- Wrapping Up
-
- Encoding / Decoding
- Wrapping Up
-
- timeit
- Importing timeit for Testing
- Use a decorator
- Create a Timing Context Manager
- cProfile
- line_profiler
- memory_profiler
- profilehooks
- Wrapping Up
-
- Hashing
- Key Derivation
- PyCrypto
- The cryptography Package
- Wrapping Up
-
- Basic SQL Syntax
- adodbapi
- pyodbc
- pypyodbc
- MySQL
- PostgreSQL
- Object Relational Mappers
- Wrapping Up
-
- Python 2 vs Python 3
- Method Resolution Order (MRO)
- Wrapping Up
-
- The Descriptor Protocol
- Calling a Descriptor
- Descriptor Examples
- Wrapping Up
-
- Local Scope
- Global Scope
- nonlocal Scope
- Wrapping Up
-
- Tips for Scraping
- Preparing to Scrape
- BeautifulSoup
- Scrapy
- Wrapping Up
-
- Wikipedia
- Other API Libraries
- Wrapping Up
-
- Connecting to an FTP Server
- Navigating Directories with ftplib
- Downloading a File via FTP
- Uploading Files to an FTP Server
- Wrapping Up
-
- urllib.request
- urllib.parse
- urllib.robotparser
- Wrapping Up
-
- How it Works
- Check Your Test With a Text File
- Option Flags and Directives
- Wrapping Up
-
- A Simple Example
- Command-Line Interface
- Creating a More Complex Test
- Creating Test Suites
- How to Skip Tests
- Integrating with doctest
- Wrapping Up
-
- Simple Examples
- Side Effects
- Autospeccing
- The Patch
- Wrapping Up
-
- Additional Information
- Wrapping Up
-
- Definitions
- async and await
- A Bad Coroutine Example
- A Better Coroutine Example
- Scheduling Calls
- Tasks
- Wrapping Up
-
- Intro to threads
- Locks and Synchronization
- Timers
- Other Thread Components
- Thread Communication
- Wrapping Up
-
- Getting Started With Multiprocessing
- Locks
- Logging
- The Pool Class
- Process Communication
- Wrapping Up
-
- Creating a Pool
- Deadlocks
- Wrapping Up