chore: clean repository history

This commit is contained in:
xixu-me committed 2026-06-05 21:13:11 +08:00
commit e1fb2929c0
661 files changed
+167488

No files matched your search

@@ -0,0 +1,21 @@
<!-- source_path: 01_Introduction/00_Overview.md -->
[Contents](../Contents.md) \| [Next (2 Working With Data)](../02_Working_with_data/00_Overview.md)
## 1. Introduction to Python
The goal of this first section is to introduce some Python basics from
the ground up. Starting with nothing, you'll learn how to edit, run,
and debug small programs. Ultimately, you'll write a short script that
reads a CSV data file and performs a simple calculation.
* [1.1 Introducing Python](01_Python.md)
* [1.2 A First Program](02_Hello_world.md)
* [1.3 Numbers](03_Numbers.md)
* [1.4 Strings](04_Strings.md)
* [1.5 Lists](05_Lists.md)
* [1.6 Files](06_Files.md)
* [1.7 Functions](07_Functions.md)
[Contents](../Contents.md) \| [Next (2 Working With Data)](../02_Working_with_data/00_Overview.md)
@@ -0,0 +1,22 @@
<!-- source_path: 02_Working_with_data/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (1 Introduction to Python)](../01_Introduction/00_Overview.md) \| [Next (3 Program Organization)](../03_Program_organization/00_Overview.md)
# 2. Working With Data
To write useful programs, you need to be able to work with data.
This section introduces Python's core data structures of tuples,
lists, sets, and dictionaries and discusses common data handling
idioms. The last part of this section dives a little deeper
into Python's underlying object model.
* [2.1 Datatypes and Data Structures](01_Datatypes.md)
* [2.2 Containers](02_Containers.md)
* [2.3 Formatted Output](03_Formatting.md)
* [2.4 Sequences](04_Sequences.md)
* [2.5 Collections module](05_Collections.md)
* [2.6 List comprehensions](06_List_comprehension.md)
* [2.7 Object model](07_Objects.md)
[Contents](../Contents.md) \| [Prev (1 Introduction to Python)](../01_Introduction/00_Overview.md) \| [Next (3 Program Organization)](../03_Program_organization/00_Overview.md)
@@ -0,0 +1,23 @@
<!-- source_path: 03_Program_organization/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (2 Working With Data)](../02_Working_with_data/00_Overview.md) \| [Next (4 Classes and Objects)](../04_Classes_objects/00_Overview.md)
# 3. Program Organization
So far, we've learned some Python basics and have written some short scripts.
However, as you start to write larger programs, you'll want to get organized.
This section dives into greater details on writing functions, handling errors,
and introduces modules. By the end you should be able to write programs
that are subdivided into functions across multiple files. We'll also give
some useful code templates for writing more useful scripts.
* [3.1 Functions and Script Writing](01_Script.md)
* [3.2 More Detail on Functions](02_More_functions.md)
* [3.3 Exception Handling](03_Error_checking.md)
* [3.4 Modules](04_Modules.md)
* [3.5 Main module](05_Main_module.md)
* [3.6 Design Discussion about Embracing Flexibility](06_Design_discussion.md)
[Contents](../Contents.md) \| [Prev (2 Working With Data)](../02_Working_with_data/00_Overview.md) \| [Next (4 Classes and Objects)](../04_Classes_objects/00_Overview.md)
@@ -0,0 +1,21 @@
<!-- source_path: 04_Classes_objects/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (3 Program Organization)](../03_Program_organization/00_Overview.md) \| [Next (5 Inner Workings of Python Objects)](../05_Object_model/00_Overview.md)
# 4. Classes and Objects
So far, our programs have only used built-in Python datatypes. In
this section, we introduce the concept of classes and objects. You'll
learn about the `class` statement that allows you to make new objects.
We'll also introduce the concept of inheritance, a tool that is commonly
use to build extensible programs. Finally, we'll look at a few other
features of classes including special methods, dynamic attribute lookup,
and defining new exceptions.
* [4.1 Introducing Classes](01_Class.md)
* [4.2 Inheritance](02_Inheritance.md)
* [4.3 Special Methods](03_Special_methods.md)
* [4.4 Defining new Exception](04_Defining_exceptions.md)
[Contents](../Contents.md) \| [Prev (3 Program Organization)](../03_Program_organization/00_Overview.md) \| [Next (5 Inner Workings of Python Objects)](../05_Object_model/00_Overview.md)
@@ -0,0 +1,25 @@
<!-- source_path: 05_Object_model/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (4 Classes and Objects)](../04_Classes_objects/00_Overview.md) \| [Next (6 Generators)](../06_Generators/00_Overview.md)
# 5. Inner Workings of Python Objects
This section covers some of the inner workings of Python objects.
Programmers coming from other programming languages often find
Python's notion of classes lacking in features. For example, there is
no notion of access-control (e.g., private, protected), the whole
`self` argument feels weird, and frankly, working with objects
sometimes feel like a "free for all." Maybe that's true, but we'll
find out how it all works as well as some common programming idioms to
better encapsulate the internals of objects.
It's not necessary to worry about the inner details to be productive.
However, most Python coders have a basic awareness of how classes
work. So, that's why we're covering it.
* [5.1 Dictionaries Revisited (Object Implementation)](01_Dicts_revisited.md)
* [5.2 Encapsulation Techniques](02_Classes_encapsulation.md)
[Contents](../Contents.md) \| [Prev (4 Classes and Objects)](../04_Classes_objects/00_Overview.md) \| [Next (6 Generators)](../06_Generators/00_Overview.md)
@@ -0,0 +1,21 @@
<!-- source_path: 06_Generators/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (5 Inner Workings of Python Objects)](../05_Object_model/00_Overview.md) \| [Next (7 Advanced Topics)](../07_Advanced_Topics/00_Overview.md)
# 6. Generators
Iteration (the `for`-loop) is one of the most common programming
patterns in Python. Programs do a lot of iteration to process lists,
read files, query databases, and more. One of the most powerful
features of Python is the ability to customize and redefine iteration
in the form of a so-called "generator function." This section
introduces this topic. By the end, you'll write some programs that
process some real-time streaming data in an interesting way.
* [6.1 Iteration Protocol](01_Iteration_protocol.md)
* [6.2 Customizing Iteration with Generators](02_Customizing_iteration.md)
* [6.3 Producer/Consumer Problems and Workflows](03_Producers_consumers.md)
* [6.4 Generator Expressions](04_More_generators.md)
[Contents](../Contents.md) \| [Prev (5 Inner Workings of Python Objects)](../05_Object_model/00_Overview.md) \| [Next (7 Advanced Topics)](../07_Advanced_Topics/00_Overview.md)
@@ -0,0 +1,24 @@
<!-- source_path: 07_Advanced_Topics/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (6 Generators)](../06_Generators/00_Overview.md) \| [Next (8 Testing and Debugging)](../08_Testing_debugging/00_Overview.md)
# 7. Advanced Topics
In this section, we look at a small set of somewhat more advanced
Python features that you might encounter in your day-to-day coding.
Many of these topics could have been covered in earlier course
sections, but weren't in order to spare you further head-explosion at
the time.
It should be emphasized that the topics in this section are only meant
to serve as a very basic introduction to these ideas. You will need
to seek more advanced material to fill out details.
* [7.1 Variable argument functions](01_Variable_arguments.md)
* [7.2 Anonymous functions and lambda](02_Anonymous_function.md)
* [7.3 Returning function and closures](03_Returning_functions.md)
* [7.4 Function decorators](04_Function_decorators.md)
* [7.5 Static and class methods](05_Decorated_methods.md)
[Contents](../Contents.md) \| [Prev (6 Generators)](../06_Generators/00_Overview.md) \| [Next (8 Testing and Debugging)](../08_Testing_debugging/00_Overview.md)
@@ -0,0 +1,15 @@
<!-- source_path: 08_Testing_debugging/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (7 Advanced Topics)](../07_Advanced_Topics/00_Overview.md) \| [Next (9 Packages)](../09_Packages/00_Overview.md)
# 8. Testing and debugging
This section introduces a few basic topics related to testing,
logging, and debugging.
* [8.1 Testing](01_Testing.md)
* [8.2 Logging, error handling and diagnostics](02_Logging.md)
* [8.3 Debugging](03_Debugging.md)
[Contents](../Contents.md) \| [Prev (7 Advanced Topics)](../07_Advanced_Topics/00_Overview.md) \| [Next (9 Packages)](../09_Packages/00_Overview.md)
@@ -0,0 +1,22 @@
<!-- source_path: 09_Packages/00_Overview.md -->
[Contents](../Contents.md) \| [Prev (8 Testing and Debugging)](../08_Testing_debugging/00_Overview.md)
# 9 Packages
We conclude the course with a few details on how to organize your code
into a package structure. We'll also discuss the installation of
third party packages and preparing to give your own code away to others.
The subject of packaging is an ever-evolving, overly complex part of
Python development. Rather than focus on specific tools, the main
focus of this section is on some general code organization principles
that will prove useful no matter what tools you later use to give code
away or manage dependencies.
* [9.1 Packages](01_Packages.md)
* [9.2 Third Party Modules](02_Third_party.md)
* [9.3 Giving your code to others](03_Distribution.md)
[Contents](../Contents.md) \| [Prev (8 Testing and Debugging)](../08_Testing_debugging/00_Overview.md)