Python has become one of the most popular programming languages because of its clear, easy-to-read style and wide applicability. Ranked fourth in the Tiobe rankings, it is a veritable first language of AI.
Another reason for the popularity is that Python has very many third-party libraries. For example, Django/flask for Web development, numpy/scipy for scientific Computing, Scikit-learn for machine learning, supervisor/fabric for operations, beautifulsoup/for web crawlers Scrapy ... You can easily invoke the implementation without rebuilding the wheel.
Using Python for data analysis
Uploading ...
Crawling Web page data with Python
Write a little game with Python
Study hard for a week, you can write a snake
Using Python to write tool scripts
Write a script that automatically steals tickets in Python
You think this is a long way from you? But programming can be exploited in many scenarios in your work and life.
For example, with a slightly larger level of data, office performance simply does not meet demand, and Python can be easily processed and analyzed. Microsoft is also considering Python as an official scripting language for Excel, and because of the applicability of Python, it can not only implement VBA functions, but also replace field functions.
For example, if you want to do some market research, then write a crawler in Python, you can obtain the Internet data in bulk, these are valuable raw materials.
You can also write some useful tool scripts, such as jumping automatic brush tools, such as auto-rob the ticket plug-in, File batch processing tool ...
If you find these difficult, it may be that technology limits your imagination.
Python's extensive application scenario
So whether it's usability or usability, Python is the most cost-effective option for learning programming. If you learn other languages, then learning Python will greatly widen your skill tree and be able to get involved in more areas.
Learning to program from the beginning to the abandonment of countless people, to a large extent, because the output and input energy is completely not proportional. and learning Python, a few lines of code can be implemented a crawler, a few functions can do simple data analysis, write a small tool, small game is minutes of things ... This sense of accomplishment will inspire your most primitive interests.
So how do you learn Python systematically? In general we will experience the following stages.
01 Understanding the basics of Python programming
The first is the variables, programming specifications, basic syntax, and so on, which is a prerequisite to get started writing Python code.
The second is data structure, string, list, dictionary, tuple these need to be very skilled, the data type will be throughout your entire programming always.
In this section, some simple exercises are to construct a data type and then implement the basic usage. For example, you construct a list to implement basic operations such as Len (), Max (), Min () function, and append (), count (), extend (), and so on, to access, update, and delete data in the list.
Function and method is the basic way to realize the data deletion and change, if you encounter the problem of data operation in the actual operation, you can find the relevant usage under the specific data type.
The Python function and process Control
Learning Python's functions and control statements is really the process of solving the problem. How to realize the judgment and the bad, how to encapsulate the fixed function module into function, these are not only the necessary condition of writing code, but also the way of training programming thinking.
This part of the function is no different from the definition of functions, function calls and parameter passing, but to be able to skillfully write functions to achieve the corresponding functions, need to pay attention to a lot of details, but also need to train constantly.
Process control is relatively better grasp some, conditional statements and the following bad statements in different scenarios practice several times, know the judgment and the process of the loop implementation, basically no problem.
In fact, to this place, basic python knowledge you have mastered, you can do some small projects, such as guessing numbers, various converters, bookkeeping tools ...
03 Doing something with Python
Usually after a period of study, you will have the process of self-doubt, seemingly really understand, but far from making the actual things, these things are useful?
This is a time to learn about some third-party libraries, and you can do more things. For example, with pandas for data processing, using Matplotlib to do visual analysis, with BeautifulSoup to write crawlers, using flask to build the site ... These other people put on the wheel, you can directly use it. Of course, like writing crawlers and Web sites, you also need to know some other aspects of knowledge (such as HTTP, HTML, JS, database, etc.).
For different libraries, internal methods, functions you also need to familiar with the beginning of the first time to master a few of the most commonly used methods, in the face of actual problems, then to check the corresponding more usage, this will be more efficient.
04 in-depth Python programming
In fact, the third stage of practice, you have basic skills to work, such as Python data analysis, web crawler, writing tool script ...
First you need to understand the advanced features of Python, such as iterators, generators, adorners, and so on, to understand classes and object-oriented concepts. Go deeper, you can explore the Python implementation principle, Python performance optimization, jump out of the Python language itself, to understand the computer interaction principle, there is a long way to go, but not everyone needs this process.
But these strategically advantageous position are the important conditions in which you are rooted in this field, and it is necessary for those who are determined to take the technical direction. This time you go to do some of the application level of things, and will have a deeper understanding.
To summarize down, learn python, the most common pits have these:
1. It is difficult to find suitable and high-quality learning resources, difficult to start, or to find some materials to begin learning, extremely easy from the start to abandon;
2. Encounter problems do not know how to find solutions, even the problem is not clearly described, often by some small problems stuck, learning efficiency is not high;
3. In the theory of learning can not extricate themselves, learning for a long time, found still do not know how to apply in the actual project, lack of ability to solve problems;
4. Seeing someone else's case feels like it is, but it's still difficult to write the code yourself, and you can't train programming thinking.
Abstract ①:python How to set environment variables? I need the details, notepad++ how to download the plugin? I'm a mess now, how do I run?
Solve:
Add the Python installation path to the path
notepad++ is simple, simple to use and notepad, but it is more powerful than Notepad ~ ~ See what you need to function.
Question Summary ②:
Save, and then run this in command-line mode, you can get the result 55, but why is there an error in interactive mode?
Indentation where does the problem arise?
Solve:
In the python interactive environment, if there is a syntax error, the program after running will error, and will get error messages, can help us to easily find the number of errors and wrong content, as long as we can charm the right remedy, bug solved by minutes ~ ~
In an interactive environment, the input code is not saved, and the code entered before the Python is closed will not be saved. However, by pressing the up and down keys in the keyboard in an interactive environment, you can look for historical commands, but it is a transient memory, and when you exit the program, these commands cease to exist.
Using the command line is inconvenient if you need to write a longer program. You can now edit the script using a text editor. You can create a new window by clicking on the file at the top left of the idle and then selecting the new Windows menu, as shown in:
Here, you can write your code, but be careful to indent, or you will often see indentation (indentation) errors, and the indentation of statements is quite important in python, because different indents reflect the relationships between different levels of a statement block. The prepared file needs to be saved (Ctrl+s) and then saved with the extension name of. Py. Once saved, press the shortcut key F5 to run the program, then in the idle window you can see the results of the run. Of course you can also right-click on run to run the program.
Small series have their own Python learning Exchange group, if you want to learn, you can add: 588+090+942 Whether you are small white or Daniel, small parts are welcome, and small series in the group will not regularly share dry goods, including a small series of their own finishing a 2018 of the latest learning materials and 0 Basic introductory tutorial , Welcome to beginner and advanced in the small partners
What is the quickest way to get to know python on the way to mastery?