gitmyhub

show-me-the-code

★ 14k updated 6y ago

Python 练习册,每天一个小程序

A numbered series of practical Python mini-projects added one per day, covering real tasks like web scraping, database storage, image resizing, and building simple web apps.

PythonMySQLRedisFlasksetup: easycomplexity 2/5

This is a collection of Python practice exercises, organized as a numbered series of small programs, with one new challenge added each day. The name comes from a quote by Linus Torvalds: "Talk is cheap. Show me the code." The goal is to build practical Python skills through hands-on mini-projects rather than textbook drills.

The exercises are practical and grounded in real tasks you might actually want to automate. Early challenges include generating activation codes for a mobile app, storing those codes in a MySQL or Redis database, counting how many times each word appears in a text file, and resizing a folder full of photos to fit a specific screen size. Each problem is numbered sequentially starting from problem 0000, and they gradually cover more territory.

As the series progresses, the problems move into web scraping (downloading images from a website), text processing (extracting links and main body text from HTML files), data file handling (reading and writing Excel and XML files), and basic security (hashing passwords before saving them). There are also challenges around building simple web applications using Python web frameworks, such as a guestbook and a to-do list. One problem asks you to use Python to pick up voice input and automatically open a website in a browser.

The collection is written primarily in Chinese, though the author notes that most problems can be adapted to other programming languages. Each problem comes with references to external reading materials, and some solutions are available in a companion repository. The author maintains this as an ongoing series.

This is a self-study resource for people who already have some Python basics and want to practice on bite-sized, real-world-flavored problems. It is not a structured course with explanations or video lessons. If you have no programming background at all, you would likely find it difficult to follow without additional guidance alongside it.

Where it fits