After reading the python tutorial, I still don't know how to program it?

Source: Internet
Author: User
After reading MOOC's tutorials, I can write all the exercises above, but I still have no clue about what to do. I heard that the only way to learn programming is programming, so I cannot compile it now. Can I learn how to copy the code on my blog? Ps: I am copying a code for Baidu Post Bar crawler. After reading MOOC's tutorials, I can write all the exercises above, but I still have no clue about what to do. I heard that the only way to learn programming is programming, so I cannot compile it now. Can I learn how to copy the code on my blog?
Ps: I am copying a code for Baidu Post Bar crawler. Reply: I made a table dish, but all of them were made of ready-made cooked food. All you did was cut and loaded into the plate. Every import module is equivalent to a piece of cooked beef, but it cannot be made by ourselves. First, I declare that I have just been in touch. The following is my opinion based on my personal experience.

To learn programming, the first rule is to be lazy.

How is it "lazy? For example, if I log on to my school website every day, I can only access the internet. If I do not log on, I have to go up to see how much traffic is there. But I don't want to repeat the following actions every day:

Open your mobile phone/computer --> browser --> school official website --> gateway --> enter your account to log on.

These actions are meaningless and cumbersome for me, so I want to try to write a program for me. Just recently I learned Python and crawler, so I started to do it.

Oh, there is actually a urllib and urllib2 library.
Oh, so you can POST the data.
Oh, you can pretend to be a browser.

You see, it means that I am a self-taught php, and I want to write a message board within one month, So Baidu has a simple message board source code, write while reading.
In 2 months, I changed the message board to a blog, added a function every few days, added a function every few days, and found my job. Now I am developing crm.
At the beginning, it was like making dumplings in a teapot. I had no idea what to do with the first step and what to do with the second step, you can do what you want. You are not invited to answer your questions.

If you have no basic knowledge or do not have much experience in writing a complete project, after learning the basic Python syntax,
You can use the following methods to learn more:
  • Write crawlers and learn the Scrapy framework (difficulty: two stars)
  • Create a website or blog, learn about the Django framework, and then turn to the flask framework (three stars in difficulty)
  • Learn about numpy and other packages and use python for scientific computing or data mining (four stars are difficult and scientific research is required)
  • View the Python project on Github, view the project source code, and write an issue for the project-> perform a test-> write a document-> modify a Bug-> Add a function (five stars for difficulty)

In my opinion, to learn a language, we should first create a complete small project (not too large) through the network channel or Entity Library channel ).

Then we recommend two previous study columns (cover your face and escape ..):
  1. Favorite Python-collectionCrawler Series
  2. Django songs-collectionAfter learning about Django, you can build a complete blog.

Good luck! To learn a programming language, the best case is to learn with demand. The subject should be able to understand the problem only in the course of learning, rather than thinking about how to apply it. Therefore, the subject will not be very solid and cannot locate the corresponding knowledge when using the question.
My learning experience in programming is to set a major goal, such as completing a crawler or a recommendation algorithm for a shopping website, and learning based on my needs, in this way, the day when your goal is completed is a success.

We also recommend learning materials from the original English version.

I hope it will be helpful. Maybe the subject does not know what to do.

In particular, programming languages generally encapsulate underlying functions to simplify development. Using encapsulation means that you need to use the library, and using the library means you need to know which library is available. Python is more abstract than C/C ++.
But it does not mean that all common databases should be learned one by one.

The general practice is to pick a desired function and try to implement it. This function can be large or small. Then, we gradually add functions and learn relevant knowledge as to what functions we need.

The earliest web crawler I developed was a cartoon download loader (IFComicDownloader) written in C ++ and Windows sdks. Later, Libcurl was used to simplify network communication (mainly for websites that detect reference anti-external links), and LUA was used to conveniently add and modify supported websites, we found a free server to automatically update the script for capturing web pages, and used the sqlite database to save data permanently. Last night, I modified a script to bypass the barrier blocking (...) of a cartoon website (......). So there is no learning direction if there is no need.

The subject said that he was copying the Baidu Post Bar crawler code. From my point of view, the disadvantage of copying code is that it is hard to know why it is used (Why is list used here, why does lambda and so on ). This may lead to unexpected problems in the future. If you have a requirement, you can copy the Code with the problem to avoid this problem.

Instead of copying Baidu Post Bar crawler code, you should first think about what features you think crawlers need, and then take the initiative to find information. Start with a simple one, such as entering the URL of a post and downloading all replies (and the middle floor) of a post to a text file. Then the demand will come out slowly. For example, how to bypass Baidu's "non-Baidu users cannot view images" and how to conveniently count the most active users in the post. Later, it may evolve into counting which users are paying attention to each other and then developing a user association Diagram for Baidu Post Bar. Analyze which users are the accounts or advertisement numbers of a specific ID, and then study numpy to perform big data statistics. There are a lot of people who can learn programming languages and use it to do a lot of math problems, but few people use it to create products, because most people do not know how to do things they have never done. So I think the correct approach is:
1. Identify what you want to do and what functions you have.
2. Find out the technologies required to implement these functions.
3. The entire software function is subdivided, followed by step subdivision modules.
4. Code each module that implements each function provides interfaces for debugging.
5. Integrate the access function module and complete debugging.




The sophomore dog did not intend to summarize the methods when doing things by himself, so he should use them with caution. MOOC .. These guys are not going to teach you how to program. Of course you can't .. An Introduction to Interactive Programming in Python

The Open Class is great. Every lecture will make you a small game. It is very simple, but it is very interesting to get familiar with and cultivate programming habits. I strongly recommend you look at it,

Learn at the same time. You can exchange ideas and find exercises to do.

Find another project.

Your reason is: no programming logic.

Read the article written by Huang ge.
How to crack the layer of python Programming
Https://github.com/pythonpeixun/article/blob/master/pythonstudy.md

Three languages: python2, php, and go
Https://github.com/pythonpeixun/article/blob/master/jdstb.md
A small piece of code illustrates the use of @ property decorators
A small piece of code illustrates the use of @ property decorators

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.