The Quick Python Book
معرفی کتاب «The Quick Python Book» نوشتهٔ Naomi Ceder، منتشرشده توسط نشر Manning در سال 2024. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «The Quick Python Book» در دستهٔ بدون دستهبندی قرار دارد.
The Quick Python Book, Fourth Edition MEAP V05 copyright welcome brief contents Chapter 1: About Python 1.1 Why should I use Python? 1.2 What Python does well 1.2.1 Python is easy to use 1.2.2 Python is expressive 1.2.3 Python is readable 1.2.4 Python is complete—“batteries included” 1.2.5 Python has a rich ecosystem of third party libraries 1.2.6 Python is cross-platform 1.2.7 Python is free 1.3 What Python is improving 1.3.1 Python is getting faster 1.3.2 Python doesn’t enforce variable types at compile time 1.3.3 Python is improving mobile support 1.3.4 Python is improving support for multiple processors 1.4 Summary Chapter 2: Getting started 2.1 Paradox of choice - which Python? 2.1.1 Python versions 2.1.2 Sources of Python 2.1.3 Devices, platforms, and operating systems 2.1.4 Environments and tools 2.2 Colaboratory - Jupyter notebooks in the cloud 2.2.1 Getting the source notebooks 2.2.2 Getting started with Colaboratory 2.2.3 Colaboratory’s Python version 2.3 Writing and running code in Colaboratory 2.3.1 Hello, world 2.3.2 Dealing with errors in Jupyter 2.4 Using help and dir to explore Python 2.5 Using AI tools to write Python code 2.6 Summary Chapter 3: The Quick Python overview 3.1 Python synopsis 3.2 Built-in data types 3.2.1 Numbers 3.2.2 Lists 3.2.3 Tuples 3.2.4 Strings 3.2.5 Dictionaries 3.2.6 Sets, frozensets 3.2.7 File objects 3.3 Type hints in Python 3.4 Control flow structures 3.4.1 Boolean values and expressions 3.4.2 The if-elif-else statement 3.4.3 Structural pattern matching with match 3.4.4 The while loop 3.4.5 The for loop 3.4.6 Function definition 3.4.7 Exceptions 3.4.8 Context handling using the with keyword 3.5 Module creation 3.6 Object-oriented programming 3.7 Summary Chapter 4: The absolute basics 4.1 Indentation and block structuring 4.2 Differentiating comments 4.3 Variables and assignments 4.4 Optional type hints in Python 4.4.1 Why use type hints? 4.4.2 Why not use type hints? 4.4.3 Progressive typing 4.5 Expressions 4.6 Strings 4.7 Numbers 4.7.1 Built-in numeric functions 4.7.2 Advanced numeric functions 4.7.3 Numeric computation 4.7.4 Complex numbers 4.7.5 Advanced complex-number functions 4.8 The None value 4.9 Getting input from the user 4.10 Built-in operators 4.11 Basic Python style 4.12 Summary Chapter 5: Lists, tuples, and sets 5.1 Lists are like arrays 5.2 List indices 5.3 Modifying lists 5.4 Sorting lists 5.4.1 Custom sorting 5.4.2 The sorted() function 5.5 Other common list operations 5.5.1 List membership with the in operator 5.5.2 List concatenation with the + operator 5.5.3 List initialization with the * operator 5.5.4 List minimum or maximum with min and max 5.5.5 List search with index 5.5.6 List matches with count 5.5.7 Summary of list operations 5.6 Nested lists and deep copies 5.7 Tuples 5.7.1 Tuple basics 5.7.2 One-element tuples need a comma 5.7.3 Packing and unpacking tuples 5.7.4 Converting between lists and tuples 5.8 Sets 5.8.1 Set operations 5.8.2 Frozensets 5.9 Lab : Examining a List 5.9.1 Why solve it the old-fashioned way? 5.9.2 Solving the problem with AI code generation 5.9.3 Solutions and discussion 5.10 Summary Chapter 6: Strings 6.1 Strings as sequences of characters 6.2 Basic string operations 6.3 Special characters and escape sequences 6.3.1 Basic escape sequences 6.3.2 Numeric (octal and hexadecimal) and Unicode escape sequences 6.3.3 Printing vs. evaluating strings with special characters 6.4 String methods 6.4.1 The split and join string methods 6.4.2 Converting strings to numbers 6.4.3 Getting rid of extra whitespace 6.4.4 String searching 6.4.5 Modifying strings 6.4.6 Modifying strings with list manipulations 6.4.7 Useful methods and constants 6.5 Converting from objects to strings 6.6 Using the format method 6.6.1 The format method and positional parameters 6.6.2 The format method and named parameters 6.6.3 Format specifiers 6.7 String interpolation with f-strings 6.8 Formatting strings with % 6.8.1 Using formatting sequences 6.8.2 Named parameters and formatting sequences 6.9 Bytes 6.10 Lab 6: Preprocessing Text 6.10.1 Solving the problem with AI generated code 6.10.2 Solutions and discussion 6.11 Summary Chapter 7: Dictionaries 7.1 What is a dictionary? 7.2 Other dictionary operations 7.3 Word counting 7.4 What can be used as a key? 7.5 Sparse matrices 7.6 Dictionaries as caches 7.7 Efficiency of dictionaries 7.8 Lab 7: Word Counting 7.8.1 Solving the problem with AI generated code 7.8.2 Solutions and discussion 7.9 Summary Chapter 8: Control flow 8.1 The if-elif-else statement 8.2 Structural pattern matching with match 8.3 The while loop 8.4 The for loop 8.4.1 The range function 8.4.2 Controlling range with starting and stepping values 8.4.3 The for loop and tuple unpacking 8.4.4 The enumerate function 8.4.5 The zip function 8.5 List, set, and dictionary comprehensions 8.5.1 Generator expressions 8.6 Statements, blocks, and indentation 8.7 Boolean values and expressions 8.7.1 Most Python objects can be used as Booleans 8.7.2 Comparison and Boolean operators 8.8 Writing a simple program to analyze a text file 8.9 Lab 8: Refactor word_count 8.9.1 Solving the problem with AI generated code 8.9.2 Solutions and discussion 8.10 Summary Chapter 9: Functions 9.1 Basic function definitions 9.2 Function parameter options 9.2.1 Positional parameters 9.2.2 Passing arguments by parameter name 9.2.3 Variable numbers of arguments 9.2.4 Mixing argument-passing techniques 9.3 Mutable objects as arguments 9.3.1 Mutable objects as default values 9.4 Local, nonlocal, and global variables 9.5 Assigning functions to variables 9.6 lambda expressions 9.7 Generator functions 9.8 Decorators 9.9 Lab 9: Useful functions 9.9.1 Solving the problem with AI generated code 9.9.2 Solutions and discussion 9.10 Summary Chapter 10: Modules and scoping rules 10.1 What is a module? 10.2 A first module 10.3 The import statement 10.4 The module search path 10.4.1 Where to place your own modules 10.5 Private names in modules 10.6 Library and third-party modules 10.7 Python scoping rules and namespaces 10.7.1 The built-in namespace 10.8 Lab 10: Create a module 10.8.1 Solving the problem with AI generated code 10.8.2 Solutions and discussion 10.9 Summary Chapter 11: Python programs 11.1 Creating a very basic program 11.1.1 Starting a script from a command line 11.1.2 Command-line arguments 11.1.3 Executing code only as main script 11.1.4 Redirecting the input and output of a script 11.1.5 The argparse module 11.1.6 Using the fileinput module 11.2 Running scripts in different operating systems. 11.2.1 Making a script directly executable on UNIX 11.2.2 Scripts on macOS 11.2.3 Script execution options in Windows 11.3 Programs and modules 11.4 Distributing Python applications 11.4.1 Wheels packages 11.4.2 zipapp and pex 11.4.3 py2exe and py2app 11.4.4 Creating executable programs with freeze 11.5 Lab 11: Creating a program 11.5.1 Solving the problem with AI generated code 11.5.2 Solutions and discussion 11.6 Summary Chapter 12: Using the filesystem 12.1 os and os.path vs. pathlib 12.2 Paths and pathnames 12.2.1 Absolute and relative paths 12.2.2 The current working directory 12.2.3 Accessing directories with pathlib 12.2.4 Manipulating pathnames 12.2.5 Manipulating pathnames with pathlib 12.2.6 Useful constants and functions 12.3 Getting information about files 12.3.1 Getting information about files with scandir 12.4 More filesystem operations 12.4.1 More filesystem operations with pathlib 12.5 Processing all files in a directory subtree 12.6 Lab 12: More file operations 12.6.1 Solving the problem with AI generated code 12.6.2 Solutions and discussion 12.7 Summary Chapter 13: Reading and writing files 13.1 Opening files and file objects 13.2 Closing files 13.3 Opening files in write or other modes 13.4 Functions to read and write text or binary data 13.4.1 Using binary mode 13.5 Reading and writing with pathlib 13.6 Terminal input/output and redirection 13.7 Handling structured binary data with the struct module 13.8 Pickling objects to files 13.8.1 Reasons not to pickle 13.9 Shelving objects 13.10 Lab 13: Final fixes to wc 13.10.1 Solving the problem with AI generated code 13.10.2 Solutions and discussion 13.11 Summary Chapter 14: Exceptions 14.1 Introduction to exceptions 14.1.1 General philosophy of errors and exception handling 14.1.2 A more formal definition of exceptions 14.1.3 Handling different types of exceptions 14.2 Exceptions in Python 14.2.1 Types of Python exceptions 14.2.2 Raising exceptions 14.2.3 Catching and handling exceptions 14.2.4 Defining new exceptions 14.2.5 Exception groups 14.2.6 Debugging programs with the assert statement 14.2.7 The exception inheritance hierarchy 14.2.8 Example: a disk-writing program in Python 14.2.9 Example: exceptions in normal evaluation 14.2.10 Where to use exceptions 14.3 Context managers using the with keyword 14.4 Lab 14: Add exceptions 14.4.1 Solving the problem with AI generated code 14.4.2 Solutions and discussion 14.5 Summary Chapter 15: Classes and object-oriented programming 15.1 Defining classes 15.1.1 Using a class instance as a structure or record 15.2 Instance variables 15.3 Methods 15.4 Class variables 15.4.1 An oddity with class variables 15.5 Static methods and class methods 15.5.1 Static methods 15.5.2 Class methods 15.6 Inheritance 15.7 Inheritance with class and instance variables 15.8 Recap: Basics of Python classes 15.9 Private variables and private methods 15.10 Using @property for more flexible instance variables 15.11 Scoping rules and namespaces for class instances 15.12 Destructors and memory management 15.13 Multiple inheritance 15.14 Lab 15: HTML classes 15.14.1 Solving the problem with AI generated code 15.14.2 Solutions and discussion 15.15 Summary Chapter 16: Regular expressions 16.1 What is a regular expression? 16.2 Regular expressions with special characters 16.3 Regular expressions and raw strings 16.3.1 Raw strings to the rescue 16.4 Extracting matched text from strings 16.5 Substituting text with regular expressions 16.5.1 Using a function with sub 16.6 Lab 16: Phone-Number normalizer 16.6.1 Solving the problem with AI generated code 16.6.2 Solutions and discussion 16.7 Summary
دانلود کتاب The Quick Python Book