search
HomeBackend DevelopmentPython TutorialHow to systematically teach yourself the Python language

With zero basic knowledge, if you want to learn a language to enrich yourself, Python is a good choice because it is simple, beautiful and easy to use. So how to systematically learn Python by yourself?

Some people really want to learn Python well. On the one hand, they are entangled in trivial matters and have never been able to get started. On the other hand, they are worried that the cost of learning is too high, and they are silently giving up?

Fortunately, Python is a beginner-friendly programming language, and you don’t have to spend too much time and energy to fully master it.

One of Python’s design philosophies is that it is simple and easy to learn, which is reflected in two aspects:

Simple and clear syntax: Compared with Ruby and Perl, its syntax features are no more or less, and most of them are simple and direct, without playing metaphysics.

There are many entry points: Python allows you to do many things, including scientific computing and data analysis, crawlers, web sites, games, command line utilities, etc. There is always one that interests you and is willing to invest time.

No further nonsense, there is only one shortcut to learn a language: Getting Started

1. Starting stage

Any programming language contains two parts: hard knowledge and soft knowledge. The main task in the starting stage is to master Hard knowledge. Any programming language contains two parts: hard knowledge and soft knowledge. The main task in the initial stage is to master hard knowledge.

1. Hard knowledge

"Hard knowledge" refers to the syntax, algorithms and data structures of programming languages, programming paradigms, etc., such as variables and types, loop statements, branches, functions, and classes. This part of knowledge is also universal. It seems to have mastered a kind of grammar, but in fact it has established a kind of thinking. For example, if a Java programmer is asked to learn Python, he can quickly map the object-oriented knowledge learned in Java to Python, so he can quickly master the object-oriented features of Python.
If you are new to learning programming, a reliable grammar book is very important. It may seem tedious, but it's essential for building a solid programming mindset.
The following is a list of some teaching materials suitable for beginners:

❖"Learn Python the Hard Way": http://learnpythonthehardway.org/book/
This book also explains the grammatical components of Python and comes with a lot of useful information. Practical examples, great for getting started quickly.

❖「The Hitchhiker’s Guide to Python!」:The Hitchhiker’s Guide to Python!
This guide focuses on the best practices of Python. Whether you are a Python expert or a novice, you can get great help.

❖「Python Official Documentation」: Our Documentation
Most of the questions in practice can be answered in the official documentation.

❖ Auxiliary tool: Python Tutor
A Python object visualization project that uses graphics to help you understand various concepts in Python.

Python’s philosophy:

Use one way, preferably only one way, to do one thing.

The same goes for studying. Although a variety of study materials are recommended, when actually studying, it is best to choose only one of them and stick to it.

When necessary, you may need to read books explaining data structures and algorithms. This knowledge is very helpful in understanding and using the object model in Python.


2. Soft knowledge
"Soft knowledge" refers to grammatical skills in a specific language environment, the use of class libraries, the choice of IDE, etc. Even if you don't understand this part at all and can't use it, it won't prevent you from programming, but the program you write will look a bit "silly".

The learning of this knowledge depends on the field and depth of the problem you are trying to solve. For beginners, it is easy to get lost in the initial stage, or hesitate when choosing a Python version, looking at 2.7 for a while and then switching to 3.0 for a while, or wandering in the sea of ​​class libraries, unable to extricate themselves, including Scrapy, Numpy, and Django. Try it, or participate in meaningless activities such as editor jihad, brace indentation exploration, operating system debate competition, or kneel down all day licking syntactic sugar, always thinking about how to get everything done with one line of code, or conceiving of holy A solution with perfect scores in terms of performance, security, versatility and robustness.

Many "big guys" will warn beginners to use this and that, and avoid detours. This will push beginners into real detours.
It is better to tell beginners that learning is a process that requires you to take detours and make bugs, and you can only be down-to-earth. There are no miracles, only shit.

Choose a direction and walk on first. Even if it’s dirty and ugly and you can’t walk anymore, then see if there is a better solution.

Only when you take a detour will you know the benefits of doing so, and understand why people can handwrite state machines to match but have to invent regular expressions, why process-oriented solutions can be solved but object-oriented, why I can control everything The root pointer has to automatically manage memory, why do I have to use Promise when I can nest callbacks...

More importantly, you will understand that high-level solutions are encapsulation of low-level, not any Whichever is most effective and appropriate under the circumstances.

The influx of technology is like a wave. Those old technologies that have been sealed for a long time will fade away and sooner or later they will come back. Just like the current popularity of mobile applications, mobile games and HTML5, aren't some aspects repeating the history of PCs in the past?

Therefore, don’t worry about taking the wrong path and losing your life. Perseverance and progress are the right path.

The core task in the initial stage is to master hard knowledge and properly understand soft knowledge. Only with stable roots and strong branches can we grow thick leaves and bear sweet fruits.

2. Development stage

After completing the learning of basic knowledge, you will definitely feel a sense of emptiness and doubt whether this grammar knowledge is really useful.
Yes, your suspicion is very correct. For Python to exert its value, of course it cannot stop at the syntax level.
The core task of the development stage is to “break out of Python and embrace the world”.
There will be multiple branches in front of you: scientific computing and data analysis, crawlers, web sites, games, command line utilities, etc. These are not problems that can be solved by just knowing Python syntax.
Take crawlers as an example. If you know nothing about computer networks, HTTP protocols, HTML, text encoding, and JSON, can you do this part of the job well? And your basic knowledge in the initial stage is equally important. If you even need to check the documentation on how to write loops and recursions, and you don’t even know how to implement BFS, it’s like a craftsman making a stone bench who has to think about how to use the hammer every time he lifts the hammer. Same, very inefficient.
At this stage, it is inevitable to come into contact with a large number of class libraries and read a large number of books.

°1 Class Library
"Awesome Python Project": vinta/awesome-python · GitHub
Here is a list of tool libraries that the Python community already has when you try to solve various practical problems, as shown in the figure below :

How to systematically teach yourself the Python language

You can find the class library you need according to your actual needs.
As for how to use related class libraries, the skill that must be mastered is to read the documentation. Since most documents in the open source community are written in English, students who are not good at English need to make up for it.


°2 In terms of books
Here I only list some books that I think are more helpful. For details, please read Douban’s book reviews:
Science and data analysis:
❖"Collective Intelligence Programming": Collective Intelligence Programming
❖" "The Beauty of Mathematics": The Beauty of Mathematics
❖ "Statistical Learning Methods": Statistical Learning Methods
❖ "Pattern Recognition And Machine Learning": Pattern Recognition And Machine Learning
❖ "Data Science Practice": Data Science Practice
❖ "Introduction to Data Retrieval" :Introduction to Information Retrieval
Crawler:
❖ "HTTP Definitive Guide": HTTP Definitive Guide
Web Website:
❖ "HTML & CSS Design and Build Website": HTML & CSS Design and Build Website

...

List to There is no need to continue here.
If you are smart, you will definitely find that most of the books above are not about Python, but more about professional knowledge.
In fact, the so-called "jump out of Python and embrace the world" here actually means that the combination of Python and professional knowledge can solve many practical problems. How far you can go at this stage depends more on your own professional knowledge. ​​

3. In-depth stage

At this stage, you know almost everything about Python, so you must know that Python is implemented in C language.

But how are the "dynamic features" of Python objects implemented using the relatively low-level C language that doesn't even have automatic memory management? At this time, we can no longer stay on the surface. We must bravely open the black box of Python, go deep into the language, see its history, and read its source code, only then can we truly understand its design ideas.

Here is a recommended book:
"Python Source Code Analysis": Python Source Code Analysis
This book gives a detailed explanation of the core part of the Python source code, but reading this book requires understanding of the C language memory model and pointers Have a good understanding.

In addition, Python itself is a dynamic language that combines multiple paradigms. That is to say, compared to the procedural programming of C, the functional programming such as Schema and Haskell, and the class-based object-oriented programming of Java, it is not pure enough. In other words, the "Taoism" of programming languages ​​can only be understood to a limited extent in Python. When learning a certain programming paradigm, starting from those languages ​​that are more pure for this paradigm can have a deeper understanding and understand the roots of the Python language.

Here we recommend an open course
"Programming Paradigms": Stanford University Open Course: Programming Paradigms
The lecturer has a high-level view, starting from the representative languages ​​​​of various programming paradigms, and gives the core ideas of each programming paradigm.

It is worth mentioning that this course has a very in-depth explanation of C language, such as C language paradigms and memory management. This knowledge is also very helpful for reading Python source code.

Many of Python’s best practices are hidden in well-known frameworks and libraries, such as Django, Tornado, etc. Digging for gold in their source code is also a good option.

¶ Final words
Everyone’s path to learning programming is different. In fact, most of them arrive at the same destination through different paths. There are no people who are lost, only people who cannot persevere. Although it sounds a bit chicken soup, it is true.


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Python: Games, GUIs, and MorePython: Games, GUIs, and MoreApr 13, 2025 am 12:14 AM

Python excels in gaming and GUI development. 1) Game development uses Pygame, providing drawing, audio and other functions, which are suitable for creating 2D games. 2) GUI development can choose Tkinter or PyQt. Tkinter is simple and easy to use, PyQt has rich functions and is suitable for professional development.

Python vs. C  : Applications and Use Cases ComparedPython vs. C : Applications and Use Cases ComparedApr 12, 2025 am 12:01 AM

Python is suitable for data science, web development and automation tasks, while C is suitable for system programming, game development and embedded systems. Python is known for its simplicity and powerful ecosystem, while C is known for its high performance and underlying control capabilities.

The 2-Hour Python Plan: A Realistic ApproachThe 2-Hour Python Plan: A Realistic ApproachApr 11, 2025 am 12:04 AM

You can learn basic programming concepts and skills of Python within 2 hours. 1. Learn variables and data types, 2. Master control flow (conditional statements and loops), 3. Understand the definition and use of functions, 4. Quickly get started with Python programming through simple examples and code snippets.

Python: Exploring Its Primary ApplicationsPython: Exploring Its Primary ApplicationsApr 10, 2025 am 09:41 AM

Python is widely used in the fields of web development, data science, machine learning, automation and scripting. 1) In web development, Django and Flask frameworks simplify the development process. 2) In the fields of data science and machine learning, NumPy, Pandas, Scikit-learn and TensorFlow libraries provide strong support. 3) In terms of automation and scripting, Python is suitable for tasks such as automated testing and system management.

How Much Python Can You Learn in 2 Hours?How Much Python Can You Learn in 2 Hours?Apr 09, 2025 pm 04:33 PM

You can learn the basics of Python within two hours. 1. Learn variables and data types, 2. Master control structures such as if statements and loops, 3. Understand the definition and use of functions. These will help you start writing simple Python programs.

How to teach computer novice programming basics in project and problem-driven methods within 10 hours?How to teach computer novice programming basics in project and problem-driven methods within 10 hours?Apr 02, 2025 am 07:18 AM

How to teach computer novice programming basics within 10 hours? If you only have 10 hours to teach computer novice some programming knowledge, what would you choose to teach...

How to avoid being detected by the browser when using Fiddler Everywhere for man-in-the-middle reading?How to avoid being detected by the browser when using Fiddler Everywhere for man-in-the-middle reading?Apr 02, 2025 am 07:15 AM

How to avoid being detected when using FiddlerEverywhere for man-in-the-middle readings When you use FiddlerEverywhere...

What should I do if the '__builtin__' module is not found when loading the Pickle file in Python 3.6?What should I do if the '__builtin__' module is not found when loading the Pickle file in Python 3.6?Apr 02, 2025 am 07:12 AM

Error loading Pickle file in Python 3.6 environment: ModuleNotFoundError:Nomodulenamed...

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)