gitmyhub

LearnPython

Jupyter Notebook ★ 8.5k updated 1y ago

以撸代码的形式学习Python

A Chinese-language Python learning resource with runnable code examples and Jupyter notebooks covering beginner through intermediate topics, from basic syntax to async programming and mini-projects.

PythonJupyter Notebooksetup: easycomplexity 1/5

LearnPython is a Chinese-language collection of Python code examples intended for people learning the language. The repository description translates to "Learn Python in the form of code", and the project links to a Zhihu column (Zhihu is a Chinese question-and-answer platform, similar to Quora) where the author writes accompanying explanations.

The repository is organized as a set of Python files and Jupyter notebooks, each focused on a specific topic. The files cover a wide range across beginner and intermediate territory. Beginner entries include a thousand-line introduction to Python basics, an introduction to Matplotlib for drawing charts and animations, and a simple web crawler using the Requests library. More advanced entries cover functional programming, Python decorators (a way to modify how functions behave), coroutines and asynchronous programming, metaclasses, and multi-threading versus multi-processing.

Several files focus on practical tasks: sending automated emails, reading and writing CSV files, working with Redis (a type of database used for fast message passing), scheduling recurring tasks, and building a simple RESTful API using Flask (a lightweight Python web framework). There are also entries on SQLAlchemy (a library for interacting with databases), regular expressions for text matching, and socket programming for network communication.

The collection also includes a few project-style files that go beyond syntax tutorials, such as one that builds a WeChat assistant bot, one that generates text using a Markov chain model, and one that visualizes topic relationships from Zhihu data. A Plotly directory contains charting examples written in Jupyter notebooks.

The README is written entirely in Chinese. Contributions via pull request are welcome according to the project notes.

Where it fits