Python Notes for Professionals book

    Amazing collection of free programming books

    收集中
    免費
    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/

    章節目錄

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

    常見問答

    您可以透過手機、平板或是電腦登入 HiSKIO 平台,在【我的學習】>【我的書籍】頁面,選擇想看的電子書。

    猜你喜歡

    用戶評價

    | 收集中

    銷售方案