Python Notes for Professionals book

    Amazing collection of free programming books

    Collecting
    Free
    Amazing collection of free programming books

    The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified

    Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners

    https://goalkicker.com/

    Content

    1-1Content list
    1-2About
    1-3Chapter 1: Getting started with Python Language
    1-4Section 1.1: Getting Started
    1-5Section 1.2: Creating variables and assigning values
    1-6Section 1.3: Block Indentation
    1-7Section 1.4: Datatypes
    1-8Section 1.5: Collection Types
    1-9Section 1.6: IDLE - Python GUI
    1-10Section 1.7: User Input
    1-11Section 1.8: Built in Modules and Functions
    1-12Section 1.9: Creating a module
    1-13Section 1.10: Installation of Python 2.7.x and 3.x
    1-14Section 1.11: String function - str() and repr()
    1-15Section 1.12: Installing external modules using pip
    1-16Section 1.13: Help Utility
    1-17Chapter 2: Python Data Types
    1-18Section 2.1: String Data Type
    1-19Section 2.2: Set Data Types
    1-20Section 2.3: Numbers data type
    1-21Section 2.4: List Data Type
    1-22Section 2.5: Dictionary Data Type
    1-23Section 2.6: Tuple Data Type
    1-24Chapter 3: Indentation
    1-25Section 3.1: Simple example
    1-26Section 3.2: How Indentation is Parsed
    1-27Section 3.3: Indentation Errors
    1-28Chapter 4: Comments and Documentation
    1-29Section 4.1: Single line, inline and multiline comments
    1-30Section 4.2: Programmatically accessing docstrings
    1-31Section 4.3: Write documentation using docstrings
    1-32Chapter 5: Date and Time
    1-33Section 5.1: Parsing a string into a timezone aware datetime object
    1-34Section 5.2: Constructing timezone-aware datetimes
    1-35Section 5.3: Computing time dierences
    1-36Section 5.4: Basic datetime objects usage
    1-37Section 5.5: Switching between time zones
    1-38Section 5.6: Simple date arithmetic
    1-39Section 5.7: Converting timestamp to datetime
    1-40Section 5.8: Subtracting months from a date accurately
    1-41Section 5.9: Parsing an arbitrary ISO 8601 timestamp with minimal libraries
    1-42Section 5.10: Get an ISO 8601 timestamp
    1-43Section 5.11: Parsing a string with a short time zone name into a timezone aware datetime object
    1-44Section 5.12: Fuzzy datetime parsing (extracting datetime out of a text)
    1-45Section 5.13: Iterate over dates
    1-46Chapter 6: Date Formatting
    1-47Section 6.1: Time between two date-times
    1-48Section 6.2: Outputting datetime object to string
    1-49Section 6.3: Parsing string to datetime object
    1-50Chapter 7: Enum
    1-51Section 7.1: Creating an enum (Python 2.4 through 3.3)
    1-52Section 7.2: Iteration
    1-53Chapter 8: Set
    1-54Section 8.1: Operations on sets
    1-55Section 8.2: Get the unique elements of a list
    1-56Section 8.3: Set of Sets
    1-57Section 8.4: Set Operations using Methods and Builtins
    1-58Section 8.5: Sets versus multisets
    1-59Chapter 9: Simple Mathematical Operators
    1-60Section 9.1: Division
    1-61Section 9.2: Addition
    1-62Section 9.3: Exponentiation
    1-63Section 9.4: Trigonometric Functions
    1-64Section 9.5: Inplace Operations
    1-65Section 9.6: Subtraction
    1-66Section 9.7: Multiplication
    1-67Section 9.8: Logarithms
    1-68Section 9.9: Modulus
    1-69Chapter 10: Bitwise Operators
    1-70Section 10.1: Bitwise NOT
    1-71Section 10.2: Bitwise XOR (Exclusive OR)
    1-72Section 10.3: Bitwise AND
    1-73Section 10.4: Bitwise OR
    1-74Section 10.5: Bitwise Left Shift
    1-75Section 10.6: Bitwise Right Shift
    1-76Section 10.7: Inplace Operations
    1-77Chapter 11: Boolean Operators
    1-78Section 11.1: `and` and `or` are not guaranteed to return a boolean
    1-79Section 11.2: A simple example
    1-80Section 11.3: Short-circuit evaluation
    1-81Section 11.4: and
    1-82Section 11.5: or
    1-83Section 11.6: not
    1-84Chapter 12: Operator Precedence
    1-85Section 12.1: Simple Operator Precedence Examples in python
    1-86Chapter 13: Variable Scope and Binding
    1-87Section 13.1: Nonlocal Variables
    1-88Section 13.2: Global Variables
    1-89Section 13.3: Local Variables
    1-90Section 13.4: The del command
    1-91Section 13.5: Functions skip class scope when looking up names
    1-92Section 13.6: Local vs Global Scope
    1-93Section 13.7: Binding Occurrence
    1-94Chapter 14: Conditionals
    1-95Section 14.1: Conditional Expression (or "The Ternary Operator")
    1-96Section 14.2: if, elif, and else
    1-97Section 14.3: Truth Values
    1-98Section 14.4: Boolean Logic Expressions
    1-99Section 14.5: Using the cmp function to get the comparison result of two objects
    1-100Section 14.6: Else statement
    1-101Section 14.7: Testing if an object is None and assigning it
    1-102Section 14.8: If statement
    1-103Chapter 15: Comparisons
    1-104Section 15.1: Chain Comparisons
    1-105Section 15.2: Comparison by `is` vs `==`
    1-106Section 15.3: Greater than or less than
    1-107Section 15.4: Not equal to
    1-108Section 15.5: Equal To
    1-109Section 15.6: Comparing Objects
    1-110Chapter 16: Loops
    1-111Section 16.1: Break and Continue in Loops
    1-112Section 16.2: For loops
    1-113Section 16.3: Iterating over lists
    1-114Section 16.4: Loops with an "else" clause
    1-115Section 16.5: The Pass Statement
    1-116Section 16.6: Iterating over dictionaries
    1-117Section 16.7: The "half loop" do-while
    1-118Section 16.8: Looping and Unpacking
    1-119Section 16.9: Iterating dierent portion of a list with dierent step size
    1-120Section 16.10: While Loop
    1-121Chapter 17: Arrays
    1-122Section 17.1: Access individual elements through indexes
    1-123Section 17.2: Basic Introduction to Arrays
    1-124Section 17.3: Append any value to the array using append() method
    1-125Section 17.4: Insert value in an array using insert() method
    1-126Section 17.5: Extend python array using extend() method
    1-127Section 17.6: Add items from list into array using fromlist() method
    1-128Section 17.7: Remove any array element using remove() method
    1-129Section 17.8: Remove last array element using pop() method
    1-130Section 17.9: Fetch any element through its index using index() method
    1-131Section 17.10: Reverse a python array using reverse() method
    1-132Section 17.11: Get array buer information through buer_info() method
    1-133Section 17.12: Check for number of occurrences of an element using count() method
    1-134Section 17.13: Convert array to string using tostring() method
    1-135Section 17.14: Convert array to a python list with same elements using tolist() method
    1-136Section 17.15: Append a string to char array using fromstring() method
    1-137Chapter 18: Multidimensional arrays
    1-138Section 18.1: Lists in lists
    1-139Section 18.2: Lists in lists in lists in..
    1-140Chapter 19: Dictionary
    1-141Section 19.1: Introduction to Dictionary
    1-142Section 19.2: Avoiding KeyError Exceptions
    1-143Section 19.3: Iterating Over a Dictionary
    1-144Section 19.4: Dictionary with default values
    1-145Section 19.5: Merging dictionaries
    1-146Section 19.6: Accessing keys and values
    1-147Section 19.7: Accessing values of a dictionary
    1-148Section 19.8: Creating a dictionary
    1-149Section 19.9: Creating an ordered dictionary
    1-150Section 19.10: Unpacking dictionaries using the ** operator
    1-151Section 19.11: The trailing comma
    1-152Section 19.12: The dict() constructor
    1-153Section 19.13: Dictionaries Example
    1-154Section 19.14: All combinations of dictionary values
    1-155Chapter 20: List
    1-156Section 20.1: List methods and supported operators
    1-157Section 20.2: Accessing list values
    1-158Section 20.3: Checking if list is empty
    1-159Section 20.4: Iterating over a list
    1-160Section 20.5: Checking whether an item is in a list
    1-161Section 20.6: Any and All
    1-162Section 20.7: Reversing list elements
    1-163Section 20.8: Concatenate and Merge lists
    1-164Section 20.9: Length of a list
    1-165Section 20.10: Remove duplicate values in list
    1-166Section 20.11: Comparison of lists
    1-167Section 20.12: Accessing values in nested list
    1-168Section 20.13: Initializing a List to a Fixed Number of Elements
    1-169Chapter 21: List comprehensions
    1-170Section 21.1: List Comprehensions
    1-171Section 21.2: Conditional List Comprehensions
    1-172Section 21.3: Avoid repetitive and expensive operations using conditional clause
    1-173Section 21.4: Dictionary Comprehensions
    1-174Section 21.5: List Comprehensions with Nested Loops
    1-175Section 21.6: Generator Expressions
    1-176Section 21.7: Set Comprehensions
    1-177Section 21.8: Refactoring filter and map to list comprehensions
    1-178Section 21.9: Comprehensions involving tuples
    1-179Section 21.10: Counting Occurrences Using Comprehension
    1-180Section 21.11: Changing Types in a List
    1-181Section 21.12: Nested List Comprehensions
    1-182Section 21.13: Iterate two or more list simultaneously within list comprehension
    1-183Chapter 22: List slicing (selecting parts of lists)
    1-184Section 22.1: Using the third "step" argument
    1-185Section 22.2: Selecting a sublist from a list
    1-186Section 22.3: Reversing a list with slicing
    1-187Section 22.4: Shifting a list using slicing
    1-188Chapter 23: groupby()
    1-189Section 23.1: Example 4
    1-190Section 23.2: Example 2
    1-191Section 23.3: Example 3
    1-192Chapter 24: Linked lists
    1-193Section 24.1: Single linked list example
    1-194Chapter 25: Linked List Node
    1-195Section 25.1: Write a simple Linked List Node in python
    1-196Chapter 26: Filter
    1-197Section 26.1: Basic use of filter
    1-198Section 26.2: Filter without function
    1-199Section 26.3: Filter as short-circuit check
    1-200Section 26.4: Complementary function: filterfalse, ifilterfalse
    1-201Chapter 27: Heapq
    1-202Section 27.1: Largest and smallest items in a collection
    1-203Section 27.2: Smallest item in a collection
    1-204Chapter 28: Tuple
    1-205Section 28.1: Tuple
    1-206Section 28.2: Tuples are immutable
    1-207Section 28.3: Packing and Unpacking Tuples
    1-208Section 28.4: Built-in Tuple Functions
    1-209Section 28.5: Tuple Are Element-wise Hashable and Equatable
    1-210Section 28.6: Indexing Tuples
    1-211Section 28.7: Reversing Elements
    1-212Chapter 29: Basic Input and Output
    1-213Section 29.1: Using the print function
    1-214Section 29.2: Input from a File
    1-215Section 29.3: Read from stdin
    1-216Section 29.4: Using input() and raw_input()
    1-217Section 29.5: Function to prompt user for a number
    1-218Section 29.6: Printing a string without a newline at the end
    1-219Chapter 30: Files & Folders I/O
    1-220Section 30.1: File modes
    1-221Section 30.2: Reading a file line-by-line
    1-222Section 30.3: Iterate files (recursively)
    1-223Section 30.4: Getting the full contents of a file
    1-224Section 30.5: Writing to a file
    1-225Section 30.6: Check whether a file or path exists
    1-226Section 30.7: Random File Access Using mmap
    1-227Section 30.8: Replacing text in a file
    1-228Section 30.9: Checking if a file is empty
    1-229Section 30.10: Read a file between a range of lines
    1-230Section 30.11: Copy a directory tree
    1-231Section 30.12: Copying contents of one file to a dierent file
    1-232Chapter 31: os.path
    1-233Section 31.1: Join Paths
    1-234Section 31.2: Path Component Manipulation
    1-235Section 31.3: Get the parent directory
    1-236Section 31.4: If the given path exists
    1-237Section 31.5: check if the given path is a directory, file, symbolic link, mount point etc
    1-238Section 31.6: Absolute Path from Relative Path
    1-239Chapter 32: Iterables and Iterators
    1-240Section 32.1: Iterator vs Iterable vs Generator
    1-241Section 32.2: Extract values one by one
    1-242Section 32.3: Iterating over entire iterable
    1-243Section 32.4: Verify only one element in iterable
    1-244Section 32.5: What can be iterable
    1-245Section 32.6: Iterator isn't reentrant!
    1-246Chapter 33: Functions
    1-247Section 33.1: Defining and calling simple functions
    1-248Section 33.2: Defining a function with an arbitrary number of arguments
    1-249Section 33.3: Lambda (Inline/Anonymous) Functions
    1-250Section 33.4: Defining a function with optional arguments
    1-251Section 33.5: Defining a function with optional mutable arguments
    1-252Section 33.6: Argument passing and mutability
    1-253Section 33.7: Returning values from functions
    1-254Section 33.8: Closure
    1-255Section 33.9: Forcing the use of named parameters
    1-256Section 33.10: Nested functions
    1-257Section 33.11: Recursion limit
    1-258Section 33.12: Recursive Lambda using assigned variable
    1-259Section 33.13: Recursive functions
    1-260Section 33.14: Defining a function with arguments
    1-261Section 33.15: Iterable and dictionary unpacking
    1-262Section 33.16: Defining a function with multiple arguments
    1-263Chapter 34: Defining functions with list arguments
    1-264Section 34.1: Function and Call
    1-265Chapter 35: Functional Programming in Python
    1-266Section 35.1: Lambda Function
    1-267Section 35.2: Map Function
    1-268Section 35.3: Reduce Function
    1-269Section 35.4: Filter Function
    1-270Chapter 36: Partial functions
    1-271Section 36.1: Raise the power
    1-272Chapter 37: Decorators
    1-273Section 37.1: Decorator function
    1-274Section 37.2: Decorator class
    1-275Section 37.3: Decorator with arguments (decorator factory)
    1-276Section 37.4: Making a decorator look like the decorated function
    1-277Section 37.5: Using a decorator to time a function
    1-278Section 37.6: Create singleton class with a decorator
    1-279Chapter 38: Classes
    1-280Section 38.1: Introduction to classes
    1-281Section 38.2: Bound, unbound, and static methods
    1-282Section 38.3: Basic inheritance
    1-283Section 38.4: Monkey Patching
    1-284Section 38.5: New-style vs. old-style classes
    1-285Section 38.6: Class methods: alternate initializers
    1-286Section 38.7: Multiple Inheritance
    1-287Section 38.8: Properties
    1-288Section 38.9: Default values for instance variables
    1-289Section 38.10: Class and instance variables
    1-290Section 38.11: Class composition
    1-291Section 38.12: Listing All Class Members
    1-292Section 38.13: Singleton class
    1-293Section 38.14: Descriptors and Dotted Lookups
    1-294Chapter 39: Metaclasses
    1-295Section 39.1: Basic Metaclasses
    1-296Section 39.2: Singletons using metaclasses
    1-297Section 39.3: Using a metaclass
    1-298Section 39.4: Introduction to Metaclasses
    1-299Section 39.5: Custom functionality with metaclasses
    1-300Section 39.6: The default metaclass
    1-301Chapter 40: String Formatting
    1-302Section 40.1: Basics of String Formatting
    1-303Section 40.2: Alignment and padding
    1-304Section 40.3: Format literals (f-string)
    1-305Section 40.4: Float formatting
    1-306Section 40.5: Named placeholders
    1-307Section 40.6: String formatting with datetime
    1-308Section 40.7: Formatting Numerical Values
    1-309Section 40.8: Nested formatting
    1-310Section 40.9: Format using Getitem and Getattr
    1-311Section 40.10: Padding and truncating strings, combined
    1-312Section 40.11: Custom formatting for a class
    1-313Chapter 41: String Methods
    1-314Section 41.1: Changing the capitalization of a string
    1-315Section 41.2: str.translate: Translating characters in a string
    1-316Section 41.3: str.format and f-strings: Format values into a string
    1-317Section 41.4: String module's useful constants
    1-318Section 41.5: Stripping unwanted leading/trailing characters from a string
    1-319Section 41.6: Reversing a string
    1-320Section 41.7: Split a string based on a delimiter into a list of strings
    1-321Section 41.8: Replace all occurrences of one substring with another substring
    1-322Section 41.9: Testing what a string is composed of
    1-323Section 41.10: String Contains
    1-324Section 41.11: Join a list of strings into one string
    1-325Section 41.12: Counting number of times a substring appears in a string
    1-326Section 41.13: Case insensitive string comparisons
    1-327Section 41.14: Justify strings
    1-328Section 41.15: Test the starting and ending characters of a string
    1-329Section 41.16: Conversion between str or bytes data and unicode characters
    1-330Chapter 42: Using loops within functions
    1-331Section 42.1: Return statement inside loop in a function
    1-332Chapter 43: Importing modules
    1-333Section 43.1: Importing a module
    1-334Section 43.2: The __all__ special variable
    1-335Section 43.3: Import modules from an arbitrary filesystem location
    1-336Section 43.4: Importing all names from a module
    1-337Section 43.5: Programmatic importing
    1-338Section 43.6: PEP8 rules for Imports
    1-339Section 43.7: Importing specific names from a module
    1-340Section 43.8: Importing submodules
    1-341Section 43.9: Re-importing a module
    1-342Section 43.10: __import__() function
    1-343Chapter 44: Dierence between Module and Package
    1-344Section 44.1: Modules
    1-345Section 44.2: Packages
    1-346Chapter 45: Math Module
    1-347Section 45.1: Rounding: round, floor, ceil, trunc
    1-348Section 45.2: Trigonometry
    1-349Section 45.3: Pow for faster exponentiation
    1-350Section 45.4: Infinity and NaN ("not a number")
    1-351Section 45.5: Logarithms
    1-352Section 45.6: Constants
    1-353Section 45.7: Imaginary Numbers
    1-354Section 45.8: Copying signs
    1-355Section 45.9: Complex numbers and the cmath module
    1-356Chapter 46: Complex math
    1-357Section 46.1: Advanced complex arithmetic
    1-358Section 46.2: Basic complex arithmetic
    1-359Chapter 47: Collections module
    1-360Section 47.1: collections.Counter
    1-361Section 47.2: collections.OrderedDict
    1-362Section 47.3: collections.defaultdict
    1-363Section 47.4: collections.namedtuple
    1-364Section 47.5: collections.deque
    1-365Section 47.6: collections.ChainMap
    1-366Chapter 48: Operator module
    1-367Section 48.1: Itemgetter
    1-368Section 48.2: Operators as alternative to an infix operator
    1-369Section 48.3: Methodcaller
    1-370Chapter 49: JSON Module
    1-371Section 49.1: Storing data in a file
    1-372Section 49.2: Retrieving data from a file
    1-373Section 49.3: Formatting JSON output
    1-374Section 49.4: `load` vs `loads`, `dump` vs `dumps`
    1-375Section 49.5: Calling `json.tool` from the command line to pretty-print JSON output
    1-376Section 49.6: JSON encoding custom objects
    1-377Section 49.7: Creating JSON from Python dict
    1-378Section 49.8: Creating Python dict from JSON
    1-379Chapter 50: Sqlite3 Module
    1-380Section 50.1: Sqlite3 - Not require separate server process
    1-381Section 50.2: Getting the values from the database and Error handling
    1-382Chapter 51: The os Module
    1-383Section 51.1: makedirs - recursive directory creation
    1-384Section 51.2: Create a directory
    1-385Section 51.3: Get current directory
    1-386Section 51.4: Determine the name of the operating system
    1-387Section 51.5: Remove a directory
    1-388Section 51.6: Follow a symlink (POSIX)
    1-389Section 51.7: Change permissions on a file
    1-390Chapter 52: The locale Module
    1-391Section 52.1: Currency Formatting US Dollars Using the locale Module
    1-392Chapter 53: Itertools Module
    1-393Section 53.1: Combinations method in Itertools Module
    1-394Section 53.2: itertools.dropwhile
    1-395Section 53.3: Zipping two iterators until they are both exhausted
    1-396Section 53.4: Take a slice of a generator
    1-397Section 53.5: Grouping items from an iterable object using a function
    1-398Section 53.6: itertools.takewhile
    1-399Section 53.7: itertools.permutations
    1-400Section 53.8: itertools.repeat
    1-401Section 53.9: Get an accumulated sum of numbers in an iterable
    1-402Section 53.10: Cycle through elements in an iterator
    1-403Section 53.11: itertools.product
    1-404Section 53.12: itertools.count
    1-405Section 53.13: Chaining multiple iterators together
    1-406Chapter 54: Asyncio Module
    1-407Section 54.1: Coroutine and Delegation Syntax
    1-408Section 54.2: Asynchronous Executors
    1-409Section 54.3: Using UVLoop
    1-410Section 54.4: Synchronization Primitive: Event
    1-411Section 54.5: A Simple Websocket
    1-412Section 54.6: Common Misconception about asyncio
    1-413Chapter 55: Random module
    1-414Section 55.1: Creating a random user password
    1-415Section 55.2: Create cryptographically secure random numbers
    1-416Section 55.3: Random and sequences: shue, choice and sample
    1-417Section 55.4: Creating random integers and floats: randint, randrange, random, and uniform
    1-418Section 55.5: Reproducible random numbers: Seed and State
    1-419Section 55.6: Random Binary Decision
    1-420Chapter 56: Functools Module
    1-421Section 56.1: partial
    1-422Section 56.2: cmp_to_key
    1-423Section 56.3: lru_cache
    1-424Section 56.4: total_ordering
    1-425Section 56.5: reduce
    1-426Chapter 57: The dis module
    1-427Section 57.1: What is Python bytecode?
    1-428Section 57.2: Constants in the dis module
    1-429Section 57.3: Disassembling modules
    1-430Chapter 58: The base64 Module
    1-431Section 58.1: Encoding and Decoding Base64
    1-432Section 58.2: Encoding and Decoding Base32
    1-433Section 58.3: Encoding and Decoding Base16
    1-434Section 58.4: Encoding and Decoding ASCII85
    1-435Section 58.5: Encoding and Decoding Base85
    1-436Chapter 59: Queue Module
    1-437Section 59.1: Simple example
    1-438Chapter 60: Deque Module
    1-439Section 60.1: Basic deque using
    1-440Section 60.2: Available methods in deque
    1-441Section 60.3: limit deque size
    1-442Section 60.4: Breadth First Search
    1-443Chapter 61: Webbrowser Module
    1-444Section 61.1: Opening a URL with Default Browser
    1-445Section 61.2: Opening a URL with Dierent Browsers
    1-446Chapter 62: tkinter
    1-447Section 62.1: Geometry Managers
    1-448Section 62.2: A minimal tkinter Application
    1-449Chapter 63: pyautogui module
    1-450Section 63.1: Mouse Functions
    1-451Section 63.2: Keyboard Functions
    1-452Section 63.3: Screenshot And Image Recognition
    1-453Chapter 64: Indexing and Slicing
    1-454Section 64.1: Basic Slicing
    1-455Section 64.2: Reversing an object
    1-456Section 64.3: Slice assignment
    1-457Section 64.4: Making a shallow copy of an array
    1-458Section 64.5: Indexing custom classes: __getitem__, __setitem__ and __delitem__
    1-459Section 64.6: Basic Indexing
    1-460Chapter 65: Plotting with Matplotlib
    1-461Section 65.1: Plots with Common X-axis but dierent Y-axis : Using twinx()
    1-462Section 65.2: Plots with common Y-axis and dierent X-axis using twiny()
    1-463Section 65.3: A Simple Plot in Matplotlib
    1-464Section 65.4: Adding more features to a simple plot : axis labels, title, axis ticks, grid, and legend
    1-465Section 65.5: Making multiple plots in the same figure by superimposition similar to MATLAB
    1-466Section 65.6: Making multiple Plots in the same figure using plot superimposition with separate plot commands
    1-467Chapter 66: graph-tool
    1-468Section 66.1: PyDotPlus
    1-469Section 66.2: PyGraphviz
    1-470Chapter 67: Generators
    1-471Section 67.1: Introduction
    1-472Section 67.2: Infinite sequences
    1-473Section 67.3: Sending objects to a generator
    1-474Section 67.4: Yielding all values from another iterable
    1-475Section 67.5: Iteration
    1-476Section 67.6: The next() function
    1-477Section 67.7: Coroutines
    1-478Section 67.8: Refactoring list-building code
    1-479Section 67.9: Yield with recursion: recursively listing all files in a directory
    1-480Section 67.10: Generator expressions
    1-481Section 67.11: Using a generator to find Fibonacci Numbers
    1-482Section 67.12: Searching
    1-483Section 67.13: Iterating over generators in parallel
    1-484Chapter 68: Reduce
    1-485Section 68.1: Overview
    1-486Section 68.2: Using reduce
    1-487Section 68.3: Cumulative product
    1-488Section 68.4: Non short-circuit variant of any/all
    1-489Chapter 69: Map Function
    1-490Section 69.1: Basic use of map, itertools.imap and future_builtins.map
    1-491Section 69.2: Mapping each value in an iterable
    1-492Section 69.3: Mapping values of dierent iterables
    1-493Section 69.4: Transposing with Map: Using "None" as function argument (python 2.x only)
    1-494Section 69.5: Series and Parallel Mapping
    1-495Chapter 70: Exponentiation
    1-496Section 70.1: Exponentiation using builtins: ** and pow()
    1-497Section 70.2: Square root: math.sqrt() and cmath.sqrt
    1-498Section 70.3: Modular exponentiation: pow() with 3 arguments
    1-499Section 70.4: Computing large integer roots
    1-500Section 70.5: Exponentiation using the math module: math.pow()
    1-501Section 70.6: Exponential function: math.exp() and cmath.exp()
    1-502Section 70.7: Exponential function minus 1: math.expm1()
    1-503Section 70.8: Magic methods and exponentiation: builtin, math and cmath
    1-504Section 70.9: Roots: nth-root with fractional exponents
    1-505Chapter 71: Searching
    1-506Section 71.1: Searching for an element
    1-507Section 71.2: Searching in custom classes: __contains__ and __iter__
    1-508Section 71.3: Getting the index for strings: str.index(), str.rindex() and str.find(), str.rfind()
    1-509Section 71.4: Getting the index list and tuples: list.index(), tuple.index()
    1-510Section 71.5: Searching key(s) for a value in dict
    1-511Section 71.6: Getting the index for sorted sequences: bisect.bisect_left()
    1-512Section 71.7: Searching nested sequences
    1-513Chapter 72: Sorting, Minimum and Maximum
    1-514Section 72.1: Make custom classes orderable
    1-515Section 72.2: Special case: dictionaries
    1-516Section 72.3: Using the key argument
    1-517Section 72.4: Default Argument to max, min
    1-518Section 72.5: Getting a sorted sequence
    1-519Section 72.6: Extracting N largest or N smallest items from an iterable
    1-520Section 72.7: Getting the minimum or maximum of several values
    1-521Section 72.8: Minimum and Maximum of a sequence
    1-522Chapter 73: Counting
    1-523Section 73.1: Counting all occurrence of all items in an iterable: collections.Counter
    1-524Section 73.2: Getting the most common value(-s): collections.Counter.most_common()
    1-525Section 73.3: Counting the occurrences of one item in a sequence: list.count() and tuple.count()
    1-526Section 73.4: Counting the occurrences of a substring in a string: str.count()
    1-527Section 73.5: Counting occurrences in numpy array
    1-528Chapter 74: The Print Function
    1-529Section 74.1: Print basics
    1-530Section 74.2: Print parameters
    1-531Chapter 75: Regular Expressions (Regex)
    1-532Section 75.1: Matching the beginning of a string
    1-533Section 75.2: Searching
    1-534Section 75.3: Precompiled patterns
    1-535Section 75.4: Flags
    1-536Section 75.5: Replacing
    1-537Section 75.6: Find All Non-Overlapping Matches
    1-538Section 75.7: Checking for allowed characters
    1-539Section 75.8: Splitting a string using regular expressions
    1-540Section 75.9: Grouping
    1-541Section 75.10: Escaping Special Characters
    1-542Section 75.11: Match an expression only in specific locations
    1-543Section 75.12: Iterating over matches using `re.finditer`
    1-544Chapter 76: Copying data
    1-545Section 76.1: Copy a dictionary
    1-546Section 76.2: Performing a shallow copy
    1-547Section 76.3: Performing a deep copy
    1-548Section 76.4: Performing a shallow copy of a list
    1-549Section 76.5: Copy a set
    1-550Chapter 77: Context Managers (“with” Statement)
    1-551Section 77.1: Introduction to context managers and the with statement
    1-552Section 77.2: Writing your own context manager
    1-553Section 77.3: Writing your own contextmanager using generator syntax
    1-554Section 77.4: Multiple context managers
    1-555Section 77.5: Assigning to a target
    1-556Section 77.6: Manage Resources
    1-557Chapter 78: The __name__ special variable
    1-558Section 78.1: __name__ == '__main__'
    1-559Section 78.2: Use in logging
    1-560Section 78.3: function_class_or_module.__name__
    1-561Chapter 79: Checking Path Existence and Permissions
    1-562Section 79.1: Perform checks using os.access
    1-563Chapter 80: Creating Python packages
    1-564Section 80.1: Introduction
    1-565Section 80.2: Uploading to PyPI
    1-566Section 80.3: Making package executable
    1-567Chapter 81: Usage of "pip" module: PyPI Package Manager
    1-568Section 81.1: Example use of commands
    1-569Section 81.2: Handling ImportError Exception
    1-570Section 81.3: Force install
    1-571Chapter 82: pip: PyPI Package Manager
    1-572Section 82.1: Install Packages
    1-573Section 82.2: To list all packages installed using `pip`
    1-574Section 82.3: Upgrade Packages
    1-575Section 82.4: Uninstall Packages
    1-576Section 82.5: Updating all outdated packages on Linux
    1-577Section 82.6: Updating all outdated packages on Windows
    1-578Section 82.7: Create a requirements.txt file of all packages on the system
    1-579Section 82.8: Using a certain Python version with pip
    1-580Section 82.9: Create a requirements.txt file of packages only in the current virtualenv
    1-581Section 82.10: Installing packages not yet on pip as wheels
    1-582Chapter 83: Parsing Command Line arguments
    1-583Section 83.1: Hello world in argparse
    1-584Section 83.2: Using command line arguments with argv
    1-585Section 83.3: Setting mutually exclusive arguments with argparse
    1-586Section 83.4: Basic example with docopt
    1-587Section 83.5: Custom parser error message with argparse
    1-588Section 83.6: Conceptual grouping of arguments with argparse.add_argument_group()
    1-589Section 83.7: Advanced example with docopt and docopt_dispatch
    1-590Chapter 84: Subprocess Library
    1-591Section 84.1: More flexibility with Popen
    1-592Section 84.2: Calling External Commands
    1-593Section 84.3: How to create the command list argument
    1-594Chapter 85: setup.py
    1-595Section 85.1: Purpose of setup.py
    1-596Section 85.2: Using source control metadata in setup.py
    1-597Section 85.3: Adding command line scripts to your python package
    1-598Section 85.4: Adding installation options
    1-599Chapter 86: Recursion
    1-600Section 86.1: The What, How, and When of Recursion
    1-601Section 86.2: Tree exploration with recursion
    1-602Section 86.3: Sum of numbers from 1 to n
    1-603Section 86.4: Increasing the Maximum Recursion Depth
    1-604Section 86.5: Tail Recursion - Bad Practice
    1-605Section 86.6: Tail Recursion Optimization Through Stack Introspection
    1-606Chapter 87: Type Hints
    1-607Section 87.1: Adding types to a function
    1-608Section 87.2: NamedTuple
    1-609Section 87.3: Generic Types
    1-610Section 87.4: Variables and Attributes
    1-611Section 87.5: Class Members and Methods
    1-612Section 87.6: Type hints for keyword arguments
    1-613Chapter 88: Exceptions
    1-614Section 88.1: Catching Exceptions
    1-615Section 88.2: Do not catch everything!
    1-616Section 88.3: Re-raising exceptions
    1-617Section 88.4: Catching multiple exceptions
    1-618Section 88.5: Exception Hierarchy
    1-619Section 88.6: Else
    1-620Section 88.7: Raising Exceptions
    1-621Section 88.8: Creating custom exception types
    1-622Section 88.9: Practical examples of exception handling
    1-623Section 88.10: Exceptions are Objects too
    1-624Section 88.11: Running clean-up code with finally
    1-625Section 88.12: Chain exceptions with raise from
    1-626Chapter 89: Raise Custom Errors / Exceptions
    1-627Section 89.1: Custom Exception
    1-628Section 89.2: Catch custom Exception
    1-629Chapter 90: Commonwealth Exceptions
    1-630Section 90.1: Other Errors
    1-631Section 90.2: NameError: name '???' is not defined
    1-632Section 90.3: TypeErrors
    1-633Section 90.4: Syntax Error on good code
    1-634Section 90.5: IndentationErrors (or indentation SyntaxErrors)
    1-635Chapter 91: urllib
    1-636Section 91.1: HTTP GET
    1-637Section 91.2: HTTP POST
    1-638Section 91.3: Decode received bytes according to content type encoding
    1-639Chapter 92: Web scraping with Python
    1-640Section 92.1: Scraping using the Scrapy framework
    1-641Section 92.2: Scraping using Selenium WebDriver
    1-642Section 92.3: Basic example of using requests and lxml to scrape some data
    1-643Section 92.4: Maintaining web-scraping session with requests
    1-644Section 92.5: Scraping using BeautifulSoup4
    1-645Section 92.6: Simple web content download with urllib.request
    1-646Section 92.7: Modify Scrapy user agent
    1-647Section 92.8: Scraping with curl
    1-648Chapter 93: HTML Parsing
    1-649Section 93.1: Using CSS selectors in BeautifulSoup
    1-650Section 93.2: PyQuery
    1-651Section 93.3: Locate a text after an element in BeautifulSoup
    1-652Chapter 94: Manipulating XML
    1-653Section 94.1: Opening and reading using an ElementTree
    1-654Section 94.2: Create and Build XML Documents
    1-655Section 94.3: Modifying an XML File
    1-656Section 94.4: Searching the XML with XPath
    1-657Section 94.5: Opening and reading large XML files using iterparse (incremental parsing)
    1-658Chapter 95: Python Requests Post
    1-659Section 95.1: Simple Post
    1-660Section 95.2: Form Encoded Data
    1-661Section 95.3: File Upload
    1-662Section 95.4: Responses
    1-663Section 95.5: Authentication
    1-664Section 95.6: Proxies
    1-665Chapter 96: Distribution
    1-666Section 96.1: py2app
    1-667Section 96.2: cx_Freeze
    1-668Chapter 97: Property Objects
    1-669Section 97.1: Using the @property decorator for read-write properties
    1-670Section 97.2: Using the @property decorator
    1-671Section 97.3: Overriding just a getter, setter or a deleter of a property object
    1-672Section 97.4: Using properties without decorators
    1-673Chapter 98: Overloading
    1-674Section 98.1: Operator overloading
    1-675Section 98.2: Magic/Dunder Methods
    1-676Section 98.3: Container and sequence types
    1-677Section 98.4: Callable types
    1-678Section 98.5: Handling unimplemented behaviour
    1-679Chapter 99: Polymorphism
    1-680Section 99.1: Duck Typing
    1-681Section 99.2: Basic Polymorphism
    1-682Chapter 100: Method Overriding
    1-683Section 100.1: Basic method overriding
    1-684Chapter 101: User-Defined Methods
    1-685Section 101.1: Creating user-defined method objects
    1-686Section 101.2: Turtle example
    1-687Chapter 102: String representations of class instances: __str__ and __repr__ methods
    1-688Section 102.1: Motivation
    1-689Section 102.2: Both methods implemented, eval-round-trip style __repr__()
    1-690Chapter 103: Debugging
    1-691Section 103.1: Via IPython and ipdb
    1-692Section 103.2: The Python Debugger: Step-through Debugging with _pdb_
    1-693Section 103.3: Remote debugger
    1-694Chapter 104: Reading and Writing CSV
    1-695Section 104.1: Using pandas
    1-696Section 104.2: Writing a TSV file
    1-697Chapter 105: Writing to CSV from String or List
    1-698Section 105.1: Basic Write Example
    1-699Section 105.2: Appending a String as a newline in a CSV file
    1-700Chapter 106: Dynamic code execution with `exec` and `eval`
    1-701Section 106.1: Executing code provided by untrusted user using exec, eval, or ast.literal_eval
    1-702Section 106.2: Evaluating a string containing a Python literal with ast.literal_eval
    1-703Section 106.3: Evaluating statements with exec
    1-704Section 106.4: Evaluating an expression with eval
    1-705Section 106.5: Precompiling an expression to evaluate it multiple times
    1-706Section 106.6: Evaluating an expression with eval using custom globals
    1-707Chapter 107: PyInstaller - Distributing Python Code
    1-708Section 107.1: Installation and Setup
    1-709Section 107.2: Using Pyinstaller
    1-710Section 107.3: Bundling to One Folder
    1-711Section 107.4: Bundling to a Single File
    1-712Chapter 108: Data Visualization with Python
    1-713Section 108.1: Seaborn
    1-714Section 108.2: Matplotlib
    1-715Section 108.3: Plotly
    1-716Section 108.4: MayaVI
    1-717Chapter 109: The Interpreter (Command Line Console)
    1-718Section 109.1: Getting general help
    1-719Section 109.2: Referring to the last expression
    1-720Section 109.3: Opening the Python console
    1-721Section 109.4: The PYTHONSTARTUP variable
    1-722Section 109.5: Command line arguments
    1-723Section 109.6: Getting help about an object
    1-724Chapter 110: *args and **kwargs
    1-725Section 110.1: Using **kwargs when writing functions
    1-726Section 110.2: Using *args when writing functions
    1-727Section 110.3: Populating kwarg values with a dictionary
    1-728Section 110.4: Keyword-only and Keyword-required arguments
    1-729Section 110.5: Using **kwargs when calling functions
    1-730Section 110.6: **kwargs and default values
    1-731Section 110.7: Using *args when calling functions
    1-732Chapter 111: Garbage Collection
    1-733Section 111.1: Reuse of primitive objects
    1-734Section 111.2: Eects of the del command
    1-735Section 111.3: Reference Counting
    1-736Section 111.4: Garbage Collector for Reference Cycles
    1-737Section 111.5: Forcefully deallocating objects
    1-738Section 111.6: Viewing the refcount of an object
    1-739Section 111.7: Do not wait for the garbage collection to clean up
    1-740Section 111.8: Managing garbage collection
    1-741Chapter 112: Pickle data serialisation
    1-742Section 112.1: Using Pickle to serialize and deserialize an object
    1-743Section 112.2: Customize Pickled Data
    1-744Chapter 113: Binary Data
    1-745Section 113.1: Format a list of values into a byte object
    1-746Section 113.2: Unpack a byte object according to a format string
    1-747Section 113.3: Packing a structure
    1-748Chapter 114: Idioms
    1-749Section 114.1: Dictionary key initializations
    1-750Section 114.2: Switching variables
    1-751Section 114.3: Use truth value testing
    1-752Section 114.4: Test for "__main__" to avoid unexpected code execution
    1-753Chapter 115: Data Serialization
    1-754Section 115.1: Serialization using JSON
    1-755Section 115.2: Serialization using Pickle
    1-756Chapter 116: Multiprocessing
    1-757Section 116.1: Running Two Simple Processes
    1-758Section 116.2: Using Pool and Map
    1-759Chapter 117: Multithreading
    1-760Section 117.1: Basics of multithreading
    1-761Section 117.2: Communicating between threads
    1-762Section 117.3: Creating a worker pool
    1-763Section 117.4: Advanced use of multithreads
    1-764Section 117.5: Stoppable Thread with a while Loop
    1-765Chapter 118: Processes and Threads
    1-766Section 118.1: Global Interpreter Lock
    1-767Section 118.2: Running in Multiple Threads
    1-768Section 118.3: Running in Multiple Processes
    1-769Section 118.4: Sharing State Between Threads
    1-770Section 118.5: Sharing State Between Processes
    1-771Chapter 119: Python concurrency
    1-772Section 119.1: The multiprocessing module
    1-773Section 119.2: The threading module
    1-774Section 119.3: Passing data between multiprocessing processes
    1-775Chapter 120: Parallel computation
    1-776Section 120.1: Using the multiprocessing module to parallelise tasks
    1-777Section 120.2: Using a C-extension to parallelize tasks
    1-778Section 120.3: Using Parent and Children scripts to execute code in parallel
    1-779Section 120.4: Using PyPar module to parallelize
    1-780Chapter 121: Sockets
    1-781Section 121.1: Raw Sockets on Linux
    1-782Section 121.2: Sending data via UDP
    1-783Section 121.3: Receiving data via UDP
    1-784Section 121.4: Sending data via TCP
    1-785Section 121.5: Multi-threaded TCP Socket Server
    1-786Chapter 122: Websockets
    1-787Section 122.1: Simple Echo with aiohttp
    1-788Section 122.2: Wrapper Class with aiohttp
    1-789Section 122.3: Using Autobahn as a Websocket Factory
    1-790Chapter 123: Sockets And Message Encryption/Decryption Between Client and Server
    1-791Section 123.1: Server side Implementation
    1-792Section 123.2: Client side Implementation
    1-793Chapter 124: Python Networking
    1-794Section 124.1: Creating a Simple Http Server
    1-795Section 124.2: Creating a TCP server
    1-796Section 124.3: Creating a UDP Server
    1-797Section 124.4: Start Simple HttpServer in a thread and open the browser
    1-798Section 124.5: The simplest Python socket client-server example
    1-799Chapter 125: Python HTTP Server
    1-800Section 125.1: Running a simple HTTP server
    1-801Section 125.2: Serving files
    1-802Section 125.3: Basic handling of GET, POST, PUT using BaseHTTPRequestHandler
    1-803Section 125.4: Programmatic API of SimpleHTTPServer
    1-804Chapter 126: Flask
    1-805Section 126.1: Files and Templates
    1-806Section 126.2: The basics
    1-807Section 126.3: Routing URLs
    1-808Section 126.4: HTTP Methods
    1-809Section 126.5: Jinja Templating
    1-810Section 126.6: The Request Object
    1-811Chapter 127: Introduction to RabbitMQ using AMQPStorm
    1-812Section 127.1: How to consume messages from RabbitMQ
    1-813Section 127.2: How to publish messages to RabbitMQ
    1-814Section 127.3: How to create a delayed queue in RabbitMQ
    1-815Chapter 128: Descriptor
    1-816Section 128.1: Simple descriptor
    1-817Section 128.2: Two-way conversions
    1-818Chapter 129: tempfile NamedTemporaryFile
    1-819Section 129.1: Create (and write to a) known, persistent temporary file
    1-820Chapter 130: Input, Subset and Output External Data Files using Pandas
    1-821Section 130.1: Basic Code to Import, Subset and Write External Data Files Using Pandas
    1-822Chapter 131: Unzipping Files
    1-823Section 131.1: Using Python ZipFile.extractall() to decompress a ZIP file
    1-824Section 131.2: Using Python TarFile.extractall() to decompress a tarball
    1-825Chapter 132: Working with ZIP archives
    1-826Section 132.1: Examining Zipfile Contents
    1-827Section 132.2: Opening Zip Files
    1-828Section 132.3: Extracting zip file contents to a directory
    1-829Section 132.4: Creating new archives
    1-830Chapter 133: Getting start with GZip
    1-831Section 133.1: Read and write GNU zip files
    1-832Chapter 134: Stack
    1-833Section 134.1: Creating a Stack class with a List Object
    1-834Section 134.2: Parsing Parentheses
    1-835Chapter 135: Working around the Global Interpreter Lock (GIL)
    1-836Section 135.1: Multiprocessing.Pool
    1-837Section 135.2: Cython nogil:
    1-838Chapter 136: Deployment
    1-839Section 136.1: Uploading a Conda Package
    1-840Chapter 137: Logging
    1-841Section 137.1: Introduction to Python Logging
    1-842Section 137.2: Logging exceptions
    1-843Chapter 138: Web Server Gateway Interface (WSGI)
    1-844Section 138.1: Server Object (Method)
    1-845Chapter 139: Python Server Sent Events
    1-846Section 139.1: Flask SSE
    1-847Section 139.2: Asyncio SSE
    1-848Chapter 140: Alternatives to switch statement from other languages
    1-849Section 140.1: Use what the language oers: the if/else construct
    1-850Section 140.2: Use a dict of functions
    1-851Section 140.3: Use class introspection
    1-852Section 140.4: Using a context manager
    1-853Chapter 141: List destructuring (aka packing and unpacking)
    1-854Section 141.1: Destructuring assignment
    1-855Section 141.2: Packing function arguments
    1-856Section 141.3: Unpacking function arguments
    1-857Chapter 142: Accessing Python source code and bytecode
    1-858Section 142.1: Display the bytecode of a function
    1-859Section 142.2: Display the source code of an object
    1-860Section 142.3: Exploring the code object of a function
    1-861Chapter 143: Mixins
    1-862Section 143.1: Mixin
    1-863Section 143.2: Overriding Methods in Mixins
    1-864Chapter 144: Attribute Access
    1-865Section 144.1: Basic Attribute Access using the Dot Notation
    1-866Section 144.2: Setters, Getters & Properties
    1-867Chapter 145: ArcPy
    1-868Section 145.1: createDissolvedGDB to create a file gdb on the workspace
    1-869Section 145.2: Printing one field's value for all rows of feature class in file geodatabase using Search Cursor
    1-870Chapter 146: Abstract Base Classes (abc)
    1-871Section 146.1: Setting the ABCMeta metaclass
    1-872Section 146.2: Why/How to use ABCMeta and @abstractmethod
    1-873Chapter 147: Plugin and Extension Classes
    1-874Section 147.1: Mixins
    1-875Section 147.2: Plugins with Customized Classes
    1-876Chapter 148: Immutable datatypes(int, float, str, tuple and frozensets)
    1-877Section 148.1: Individual characters of strings are not assignable
    1-878Section 148.2: Tuple's individual members aren't assignable
    1-879Section 148.3: Frozenset's are immutable and not assignable
    1-880Chapter 149: Incompatibilities moving from Python 2 to Python 3
    1-881Section 149.1: Integer Division
    1-882Section 149.2: Unpacking Iterables
    1-883Section 149.3: Strings: Bytes versus Unicode
    1-884Section 149.4: Print statement vs. Print function
    1-885Section 149.5: Dierences between range and xrange functions
    1-886Section 149.6: Raising and handling Exceptions
    1-887Section 149.7: Leaked variables in list comprehension
    1-888Section 149.8: True, False and None
    1-889Section 149.9: User Input
    1-890Section 149.10: Comparison of dierent types
    1-891Section 149.11: .next() method on iterators renamed
    1-892Section 149.12: filter(), map() and zip() return iterators instead of sequences
    1-893Section 149.13: Renamed modules
    1-894Section 149.14: Removed operators <> and ``, synonymous with != and repr()
    1-895Section 149.15: long vs. int
    1-896Section 149.16: All classes are "new-style classes" in Python 3
    1-897Section 149.17: Reduce is no longer a built-in
    1-898Section 149.18: Absolute/Relative Imports
    1-899Section 149.19: map()
    1-900Section 149.20: The round() function tie-breaking and return type
    1-901Section 149.21: File I/O
    1-902Section 149.22: cmp function removed in Python 3
    1-903Section 149.23: Octal Constants
    1-904Section 149.24: Return value when writing to a file object
    1-905Section 149.25: exec statement is a function in Python 3
    1-906Section 149.26: encode/decode to hex no longer available
    1-907Section 149.27: Dictionary method changes
    1-908Section 149.28: Class Boolean Value
    1-909Section 149.29: hasattr function bug in Python 2
    1-910Chapter 150: 2to3 tool
    1-911Section 150.1: Basic Usage
    1-912Chapter 151: Non-ocial Python implementations
    1-913Section 151.1: IronPython
    1-914Section 151.2: Jython
    1-915Section 151.3: Transcrypt
    1-916Chapter 152: Abstract syntax tree
    1-917Section 152.1: Analyze functions in a python script
    1-918Chapter 153: Unicode and bytes
    1-919Section 153.1: Encoding/decoding error handling
    1-920Section 153.2: File I/O
    1-921Section 153.3: Basics
    1-922Chapter 154: Python Serial Communication (pyserial)
    1-923Section 154.1: Initialize serial device
    1-924Section 154.2: Read from serial port
    1-925Section 154.3: Check what serial ports are available on your machine
    1-926Chapter 155: Neo4j and Cypher using Py2Neo
    1-927Section 155.1: Adding Nodes to Neo4j Graph
    1-928Section 155.2: Importing and Authenticating
    1-929Section 155.3: Adding Relationships to Neo4j Graph
    1-930Section 155.4: Query 1 : Autocomplete on News Titles
    1-931Section 155.5: Query 2 : Get News Articles by Location on a particular date
    1-932Section 155.6: Cypher Query Samples
    1-933Chapter 156: Basic Curses with Python
    1-934Section 156.1: The wrapper() helper function
    1-935Section 156.2: Basic Invocation Example
    1-936Chapter 157: Templates in python
    1-937Section 157.1: Simple data output program using template
    1-938Section 157.2: Changing delimiter
    1-939Chapter 158: Pillow
    1-940Section 158.1: Read Image File
    1-941Section 158.2: Convert files to JPEG
    1-942Chapter 159: The pass statement
    1-943Section 159.1: Ignore an exception
    1-944Section 159.2: Create a new Exception that can be caught
    1-945Chapter 160: CLI subcommands with precise help output
    1-946Section 160.1: Native way (no libraries)
    1-947Section 160.2: argparse (default help formatter)
    1-948Section 160.3: argparse (custom help formatter)
    1-949Chapter 161: Database Access
    1-950Section 161.1: SQLite
    1-951Section 161.2: Accessing MySQL database using MySQLdb
    1-952Section 161.3: Connection
    1-953Section 161.4: PostgreSQL Database access using psycopg2
    1-954Section 161.5: Oracle database
    1-955Section 161.6: Using sqlalchemy
    1-956Chapter 162: Connecting Python to SQL Server
    1-957Section 162.1: Connect to Server, Create Table, Query Data
    1-958Chapter 163: PostgreSQL
    1-959Section 163.1: Getting Started
    1-960Chapter 164: Python and Excel
    1-961Section 164.1: Read the excel data using xlrd module
    1-962Section 164.2: Format Excel files with xlsxwriter
    1-963Section 164.3: Put list data into a Excel's file
    1-964Section 164.4: OpenPyXL
    1-965Section 164.5: Create excel charts with xlsxwriter
    1-966Chapter 165: Turtle Graphics
    1-967Section 165.1: Ninja Twist (Turtle Graphics)
    1-968Chapter 166: Python Persistence
    1-969Section 166.1: Python Persistence
    1-970Section 166.2: Function utility for save and load
    1-971Chapter 167: Design Patterns
    1-972Section 167.1: Introduction to design patterns and Singleton Pattern
    1-973Section 167.2: Strategy Pattern
    1-974Section 167.3: Proxy
    1-975Chapter 168: hashlib
    1-976Section 168.1: MD5 hash of a string
    1-977Section 168.2: algorithm provided by OpenSSL
    1-978Chapter 169: Creating a Windows service using Python
    1-979Section 169.1: A Python script that can be run as a service
    1-980Section 169.2: Running a Flask web application as a service
    1-981Chapter 170: Mutable vs Immutable (and Hashable) in Python
    1-982Section 170.1: Mutable vs Immutable
    1-983Section 170.2: Mutable and Immutable as Arguments
    1-984Chapter 171: configparser
    1-985Section 171.1: Creating configuration file programmatically
    1-986Section 171.2: Basic usage
    1-987Chapter 172: Optical Character Recognition
    1-988Section 172.1: PyTesseract
    1-989Section 172.2: PyOCR
    1-990Chapter 173: Virtual environments
    1-991Section 173.1: Creating and using a virtual environment
    1-992Section 173.2: Specifying specific python version to use in script on Unix/Linux
    1-993Section 173.3: Creating a virtual environment for a dierent version of python
    1-994Section 173.4: Making virtual environments using Anaconda
    1-995Section 173.5: Managing multiple virtual environments with virtualenvwrapper
    1-996Section 173.6: Installing packages in a virtual environment
    1-997Section 173.7: Discovering which virtual environment you are using
    1-998Section 173.8: Checking if running inside a virtual environment
    1-999Section 173.9: Using virtualenv with fish shell
    1-1000Chapter 174: Python Virtual Environment - virtualenv
    1-1001Section 174.1: Installation
    1-1002Section 174.2: Usage
    1-1003Section 174.3: Install a package in your Virtualenv
    1-1004Section 174.4: Other useful virtualenv commands
    1-1005Chapter 175: Virtual environment with virtualenvwrapper
    1-1006Section 175.1: Create virtual environment with virtualenvwrapper
    1-1007Chapter 176: Create virtual environment with virtualenvwrapper in windows
    1-1008Section 176.1: Virtual environment with virtualenvwrapper for windows
    1-1009Chapter 177: sys
    1-1010Section 177.1: Command line arguments
    1-1011Section 177.2: Script name
    1-1012Section 177.3: Standard error stream
    1-1013Section 177.4: Ending the process prematurely and returning an exit code
    1-1014Chapter 178: ChemPy - python package
    1-1015Section 178.1: Parsing formulae
    1-1016Section 178.2: Balancing stoichiometry of a chemical reaction
    1-1017Section 178.3: Balancing reactions
    1-1018Section 178.4: Chemical equilibria
    1-1019Section 178.5: Ionic strength
    1-1020Section 178.6: Chemical kinetics (system of ordinary dierential equations)
    1-1021Chapter 179: pygame
    1-1022Section 179.1: Pygame's mixer module
    1-1023Section 179.2: Installing pygame
    1-1024Chapter 180: Pyglet
    1-1025Section 180.1: Installation of Pyglet
    1-1026Section 180.2: Hello World in Pyglet
    1-1027Section 180.3: Playing Sound in Pyglet
    1-1028Section 180.4: Using Pyglet for OpenGL
    1-1029Section 180.5: Drawing Points Using Pyglet and OpenGL
    1-1030Chapter 181: Audio
    1-1031Section 181.1: Working with WAV files
    1-1032Section 181.2: Convert any soundfile with python and mpeg
    1-1033Section 181.3: Playing Windows' beeps
    1-1034Section 181.4: Audio With Pyglet
    1-1035Chapter 182: pyaudio
    1-1036Section 182.1: Callback Mode Audio I/O
    1-1037Section 182.2: Blocking Mode Audio I/O
    1-1038Chapter 183: shelve
    1-1039Section 183.1: Creating a new Shelf
    1-1040Section 183.2: Sample code for shelve
    1-1041Section 183.3: To summarize the interface (key is a string, data is an arbitrary object):
    1-1042Section 183.4: Write-back
    1-1043Chapter 184: IoT Programming with Python and Raspberry PI
    1-1044Section 184.1: Example - Temperature sensor
    1-1045Chapter 185: kivy - Cross-platform Python Framework for NUI Development
    1-1046Section 185.1: First App
    1-1047Chapter 186: Pandas Transform: Preform operations on groups and concatenate the results
    1-1048Section 186.1: Simple transform
    1-1049Section 186.2: Multiple results per group
    1-1050Chapter 187: Similarities in syntax, Dierences in meaning: Python vs. JavaScript
    1-1051Section 187.1: `in` with lists
    1-1052Chapter 188: Call Python from C#
    1-1053Section 188.1: Python script to be called by C# application
    1-1054Section 188.2: C# code calling Python script
    1-1055Chapter 189: ctypes
    1-1056Section 189.1: ctypes arrays
    1-1057Section 189.2: Wrapping functions for ctypes
    1-1058Section 189.3: Basic usage
    1-1059Section 189.4: Common pitfalls
    1-1060Section 189.5: Basic ctypes object
    1-1061Section 189.6: Complex usage
    1-1062Chapter 190: Writing extensions
    1-1063Section 190.1: Hello World with C Extension
    1-1064Section 190.2: C Extension Using c++ and Boost
    1-1065Section 190.3: Passing an open file to C Extensions
    1-1066Chapter 191: Python Lex-Yacc
    1-1067Section 191.1: Getting Started with PLY
    1-1068Section 191.2: The "Hello, World!" of PLY - A Simple Calculator
    1-1069Section 191.3: Part 1: Tokenizing Input with Lex
    1-1070Section 191.4: Part 2: Parsing Tokenized Input with Yacc
    1-1071Chapter 192: Unit Testing
    1-1072Section 192.1: Test Setup and Teardown within a unittest.TestCase
    1-1073Section 192.2: Asserting on Exceptions
    1-1074Section 192.3: Testing Exceptions
    1-1075Section 192.4: Choosing Assertions Within Unittests
    1-1076Section 192.5: Unit tests with pytest
    1-1077Section 192.6: Mocking functions with unittest.mock.create_autospec
    1-1078Chapter 193: py.test
    1-1079Section 193.1: Setting up py.test
    1-1080Section 193.2: Intro to Test Fixtures
    1-1081Section 193.3: Failing Tests
    1-1082Chapter 194: Profiling
    1-1083Section 194.1: %%timeit and %timeit in IPython
    1-1084Section 194.2: Using cProfile (Preferred Profiler)
    1-1085Section 194.3: timeit() function
    1-1086Section 194.4: timeit command line
    1-1087Section 194.5: line_profiler in command line
    1-1088Chapter 195: Python speed of program
    1-1089Section 195.1: Deque operations
    1-1090Section 195.2: Algorithmic Notations
    1-1091Section 195.3: Notation
    1-1092Section 195.4: List operations
    1-1093Section 195.5: Set operations
    1-1094Chapter 196: Performance optimization
    1-1095Section 196.1: Code profiling
    1-1096Chapter 197: Security and Cryptography
    1-1097Section 197.1: Secure Password Hashing
    1-1098Section 197.2: Calculating a Message Digest
    1-1099Section 197.3: Available Hashing Algorithms
    1-1100Section 197.4: File Hashing
    1-1101Section 197.5: Generating RSA signatures using pycrypto
    1-1102Section 197.6: Asymmetric RSA encryption using pycrypto
    1-1103Section 197.7: Symmetric encryption using pycrypto
    1-1104Chapter 198: Secure Shell Connection in Python
    1-1105Section 198.1: ssh connection
    1-1106Chapter 199: Python Anti-Patterns
    1-1107Section 199.1: Overzealous except clause
    1-1108Section 199.2: Looking before you leap with processor-intensive function
    1-1109Chapter 200: Common Pitfalls
    1-1110Section 200.1: List multiplication and common references
    1-1111Section 200.2: Mutable default argument
    1-1112Section 200.3: Changing the sequence you are iterating over
    1-1113Section 200.4: Integer and String identity
    1-1114Section 200.5: Dictionaries are unordered
    1-1115Section 200.6: Variable leaking in list comprehensions and for loops
    1-1116Section 200.7: Chaining of or operator
    1-1117Section 200.8: sys.argv[0] is the name of the file being executed
    1-1118Section 200.9: Accessing int literals' attributes
    1-1119Section 200.10: Global Interpreter Lock (GIL) and blocking threads
    1-1120Section 200.11: Multiple return
    1-1121Section 200.12: Pythonic JSON keys
    1-1122Chapter 201: Hidden Features
    1-1123Section 201.1: Operator Overloading
    1-1124Credits
    1-1125You may also like

    Reviews

    | Collecting

    Sales Plans