How to learn Python in a systematic way?

Source: Internet
Author: User

From August to December of four months, to remove the original work, in order to learn the quality, I will guarantee an average of 4 hours a day of study time, weekends are no exception. In addition, all the documents, questions and answers are as far as possible in English, which can help you to have a lot of time left. December 13, I do the site on-line, 3 days time about 5000 people visited this site, I sometimes in the background to look at the log, inevitably some upsurge gush, I want to write down their experience, I hope for those who want to learn programming but not the friends to provide some help and encouragement.

1. My way of self-study programming

1) Basic

At first, I knew nothing about building a website. In order to quickly build a framework for themselves, I spent a whole day on Google, understand the Html,css,javascript,ajax,jquery,react,sql, server scripting and so on knowledge, do not seek mastery, just understand what each technology is doing, On the other hand set up a learning roadmap, so that probably know what to do a web app needs to learn the priorities of the order. Two key resources are recommended:

Python basics: The hard-Learn Python

Web App Basics: @ Zhang Qiuyi's answers are easy to read and highly recommended.

With this roadmap, I understand the front-end three must master the skills Html,css and JavaScript, spent about 10 days about the W3Schools on the tutorial all over again, and then try to write a few pages, feel that their writing is not emboldened. So according to know and watercress on the recommendation, bought "Javescript DOM" and "Head first HTML and CSS", while reading the example over again.

w3schools:www.w3schools.com/

Javascript:javascript DOM Programming Art

HTML & Css:head First HTML and CSS (2nd edition)

The front end is need to learn slowly, after reading the above information, although can write some pretty page, but I know a lot of them are not in line with the standard, not to mention the code style or anything. This can only be improved by constantly accumulating and increasing the amount of code. Knowing that the server side needs to spend a lot of time, so I found that they can follow the idea of a Web page, I put the Learning Center on the server side. But every day will be time to write a page, avoid rusty.

2) server-side

The first thing to know is the HTTP protocol, which is how the browser communicates with the server. That is, when you type the URL in your browser, press Enter until the page appears in your browser, and what happens between the browser and the browser. This is very interesting content, I read the novel in the mood to understand this part of the content. Once you understand this section, you will understand why there are sometimes 404 of pages. How do I submit a search term in Baidu search box to a Baidu server? Why don't you enter the password again when you re-login?

After understanding the HTTP protocol, I was a little bit fascinated. Seemingly mysterious phenomenon in fact the principle is not complex, but you will be attracted. The next step is to get to the part where I put the most time-back-end development. I remember when I learned about the MVC (Model-view-controller) pattern of web development, there was a feeling of blood gushing, and it felt so interesting (programmers don't spray, I just haven't seen the way).

Everyone's homepage is the same layout and style, such as the top of the menu search bar, color segmentation, the left side of the dynamic and so on, the right is personal information, and then the specific content is individual--everyone's avatar, name, dynamic is not the same. So how do you make sure everyone sees their own homepage?

You can think of this same layout as a template, there are empty lattice, when you use your Account landing page, imagine your computer there are countless small person according to your account from the background of the database to take out your avatar, dynamic, certification information and so on, and corresponding to the template on the specified position, Fill in the corresponding content. The action of these little men is so fast that you feel that it is done in an instant.

The above-mentioned template is the V in MVC, which is the abbreviation for the view and is responsible for the display. The advantage of this is that if one day suddenly want to change the style of the profile, then only need to change the template, and then tens of millions of registered users of the home page is changed accordingly, because the template is common, is not a lot of things saved? (Early web development is not so, you may want to change one user, very troublesome.) )

And these little people in addition to the content, they are really responsible for the business logic, we call them controller, that is, MVC C. For example, when you log in, the villain to check your user name is not accurate, if accurate, they want to go to the database to take out the information you requested, if the user name is wrong, they want to intercept your landing. They have a lot of responsibilities that cannot be enumerated. In practice, what these little guys do is actually what Python (or other scripting language) does.

Finally, the model in MVC is the data that is passed to the view, including the avatar, user name, dynamic and so on. These data exist in the form of database tables (table) on the server, you can think of them as many different Excel tables, different tables store different information, some record the user's personal information, some record the answer, some record the comments and so on, And these tables are connected to each other, when you jump between the different Web pages, the above-mentioned people on the basis of your request, the combination of the corresponding table to take out the corresponding data, and then put them in the template corresponding to the space, sent to the browser. Then the browser according to the CSS you write, with different colors, sizes and so on, the data is very beautiful display.

What are the benefits of doing this? Although what you end up seeing in the browser is a full page, they are all differentiated on the back-end logic-the model (M), the View (V) and the controller (C) differentiate to ensure a higher maintainability-I can change the display of the homepage and see the effect at any time, I can also add some business logic at any time.

If your study persists here, first of all, congratulations. Second you may already know some very mature Python web frameworks, such as django,flask and so on, and you may see a lot of small white tutorials to teach you to use directly, after all, most people may feel that there is no need to reinvent the wheel.

Originally for the sake of convenience, I also intend to use the framework directly. I was in the design of the database, at that time in the SQLAlchemy document, I feel that relative to their own project SQLAlchemy too complex, so I decided to write my own ORM (the noun does not matter), which for me at that time is a very difficult thing. So I put a lot of energy into the daily reading about SQL and Python-related tutorials and materials, Python core programming (second edition) gave me a lot of inspiration. Once the ORM has been completed, the URL handler is also written, and no existing web framework is used.

Now looking back, I think this is the time to build the wheel is the fastest time to improve the programming ability. For example, in order to write ORM, you have to spend a lot of time learning SQL, to understand the metaclass in Python, and if you use a ready-made framework, I would probably lazy not to pay attention to some of the details. But not the problem is OK, once the problem, I can only kneel. In addition, making wheels forced me to conceive the whole frame at the beginning, because I had to think about all the situations as much as possible, so I would constantly force myself to perfect the knowledge system, contrast with other people's code to improve my own, the process is full of frustration, but the achievements and happiness are incomparable.

SQL books: Sams Teach yourself MySQL in

Python:python Core Programming (second edition)

High-quality Python resources on GitHub: codementorio/python-learning-resources

The process is also involved in the deployment, my site is running on Linux. There are a lot of high-quality tutorials on the deployment web, one search and a lot. We will not repeat it here.

These are my study of the general route, of course, the process is full of small stumbling, although the site is on the line, it seems to run relatively smooth, but if a programmer's standards to ask themselves, they are still very rookie. But I'm not as afraid of technology as I used to be, just as you understand the rationale behind the magic and think more about the principle itself.

2. Self-learning programming issues to be aware of

Many people recommend the small white first language to choose Python, because the syntax is simple. This sentence only half, Python is really easy to get started, the threshold for beginners is very low. But I found that the real threshold for small white lies in the system knowledge, which has absolutely nothing to do with what language to use. For example, many people learn the syntax of Python, it is really simple, but turned to use the Python standard library, but found that they do not even understand the document. The standard library provides an interface between Python and other system functions, ultimately enabling the interaction between Python and the system. Reading a standard library requires system knowledge, such as operating systems, databases, processes and threads, socket programming, network protocols, and so on, which are a high threshold for programming small white, but only by learning these can you really play the power of Python.

This is one of the reasons I feel that my experience is valuable to small white. Because designing a Dynamic Web page is a good practiced hand project. Creating Web pages (Web Apps) will force you to understand what your browser, network, and server have done in the browser, from the way you type the address in your browsers and press ENTER to display the page in your browser. Specifically to the technology above, you have to learn the front-end html,css and JavaScript, back-end scripts, databases, operating systems and so on. In other words, this process can motivate you to take the initiative to learn the above mentioned system knowledge, if you do another project, you will not be able to do the same as now, and have the ability to do some technical discussion, so I think this is a very good practiced hand project.

1) Be sure to spare time to add theoretical knowledge

Many people will emphasize learn by doing, while doing the project while learning, this is my own way. In this way, you keep making mistakes, correcting ... Learning efficiency is very high. However, many people go to extremes, the final result is not pay attention to theoretical knowledge of learning. You'll find that Google's capabilities are getting higher, but the real programming power is not being improved. If this is the case, you need to rethink it.

One possibility is that you are too dependent on a variety of mature frameworks, and as a result programming becomes "glue" to glue different frameworks to complete the requirements. Just like your web app used SQLAlchemy, although you do not understand SQL, but the site is also very good run. If there is a problem with the database, then you can only kneel.

Another possibility is that you are completely immersed in the project, ignoring the knowledge of learning theory. Although the project is full of difficulties, but the return is a strong sense of accomplishment, it is easy to immerse in it. I think it's extremely wrong. First of all, halfway decent programmers have not been a systematic study, did not form their own knowledge system, if you do not understand the data structure, algorithmic complexity, operating system these theories, then you can reach a very limited height. Therefore, in every day to do the project at the same time, must ensure that a certain amount of time, bad to fill the theoretical knowledge. This part of the book in the watercress and know that there are a lot of summary, you can search by themselves.

2) Don't be too tangled up with meaningless questions, such as what frames are good, XX language is better than XX language. Pre-determined the practiced hand project, to concentrate on the accumulation of code volume, accumulate the basic knowledge. The cool technology that you can't understand now you can understand what is going on, but there is no foundation, then cool frame for you are the heavenly book.

3) Learn to ask questions. The good question is based on your own practice or thinking on the basis of the question, which is responsible for themselves, but also respect for others. Do not encounter difficulties like direct Internet search: "What is the problem?" "I don't understand if you can help me see ...".

4) Learn English well.


How to learn Python in a systematic way?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.