Recommend a 7000+Star collection of common Python code on github, worth collecting!
Let's get down to business today~
Here's a project that can't be called a "project", it's a collection of Python code maintained by a foreign guy for several years.
The short version is that this little programmer guy started saving the Python code he had written a few years ago, while keeping some of his more commonly used code together as a small script, and then maintaining it on github.
I looked at it again today and so far Little Brother has over 7,000 people following this project. Whether you're a Python beginner or have been learning Python for a while, this code collection is worth your time, and why? Let's go through it.
1
First of all, there are an exceptional number of sample scripts in this codebase, and I think there are already over 100 separate scripts when I look at them roughly. Of course, it's not so much the number that matters as the variety of codes.
There are crawlers, there are asynchronous downloads, there are python mini-games, there is image processing, there is a Google News downloader, there is math processing ... Anyway, there's a lot of variety!
Why the emphasis on variety?
Because in learning to write code, we should try to avoid repetition. Writing code is not like memorizing words, you just have to know what a programming language can do and when you need to use it, you can quickly find the piece of code that implements the appropriate function, we will not be required to memorize the code. So we can keep trying to learn something new for a while.
These small examples in the Little Brother code base are not only rich in functional variety, but also use a lot of Python syntax and data structures, which are more helpful for beginners.
2
In addition to the variety, the code for each item in the code base is short enough!
While in the process of learning, we push for learning in projects. But many beginners can't help but get into an awkward situation...
Look at the project... I don't even know how to run a project. Don't look at the project... You read books all day long, and then you forget them, and in the end, you don't learn anything.
So what do we do?
It takes time to go from reading and learning to being able to get your hands on a project, such as understanding some frameworks (Django, Scrapy). Then it's helpful to look at small lines of code when you don't yet have the ability to use or read a project that consists of thousands of lines of code.
These code collections are a good choice because it is short, most scripts are between 50 and 100 lines, the longest script is just over 300 lines, and each script is complete with a small function implemented.
For every little script you figure out, you get +1 for achievement. Before getting started on a medium to large project, it's a good idea to learn these little scripts.
3
Every programmer should have a common code base of their own.
Since I started writing scripts, I've collected all the code I commonly use, such as Python scripts and Shell scripts.
Why?
Because too often we do things that are repetitive, for example I often write scripts to iterate through all the files under a folder, often use regular expressions, and often have to use some third-party libraries.
Although we "promote" search engine oriented programming - look it up when you need it - it's really time consuming to do it all the time. Most importantly, the solution may be different each time you check it out and it takes time to go through ... It's so inefficient.
Therefore, we should make it a good habit to collect the "tool" scripts that we use. Whether it's recording in cloud notes or uploading code to github, we must be deliberate in our collection. Slowly, you will find yourself writing code faster and faster ... Commonly known as the CV method.
I personally use both ways, and both youtubes and github are the more convenient and practical ones in my opinion, so you can try them out too.
Oh yeah, the address of that little brother's common Python codebase that I haven't told you guys yet is here.
https://github.com/geekcomputers/Python