Summary of the entire process of Python programming skills

Source: Internet
Author: User

The Python programming skills also adhere to a clear and uniform style in the design of other parts, which makes the Python language also known as a language that is easy to understand and easy to maintain lay a good foundation. I hope the following article will, this allows you to enjoy the python language.

However, many people will discard it after using basic for a period of time, because they feel that there are too few functions besides play. Even vb has incomplete functions. In many cases, components written in other languages and APIs can be called directly to complete functions.

Python, however, looks like a toy. In addition, the interactive command line gives people the feeling of teaching language, which strengthens people's ideas. However, python functions cannot be said to be weak, but they are actually very powerful. Python has built-in important data structures and files, and contains a large standard library.

It basically covers the functional requirements from the GUI to the database to the network. There are also many fans. Companies write third-party libraries for python. These libraries have a wide variety of functions. In addition, you can package libraries in other languages for your own use. You can use languages like c to write extended libraries directly. Therefore, python is as studious as basic, but its functions are much more powerful.

Python is slow and can only be used in a few application scenarios. For those who are used to languages such as assembly and C ++, there is always a kind of inertia in thinking (including I have gone through this stage myself ). It means that the file size is a digital section, and the overhead of any Runtime is absolutely not allowed. When we see a dynamic language such as python and a very dynamic language, It is also reasonable to see how difficult it is.

The key question first is whether you need to save that amount by 100 ~ The size of KB, the current memory, hard disk, network communication environment is not very concerned about such a little space, so the size is not a problem. Is the running time critical? In fact, in many cases, it does not require that fast speed. For example, if you open a window and run it with a latency of 100 ms, do you feel it?

Python can also convert the py file into a pyc file to accelerate the interpretation of the source file. Pre-reading such as just in time or hot spot in a java virtual machine can be equivalent to pre-compiled Technology for python.

Another major benefit of python is the ability to write extension modules in a fast language such as C. In software, 20% of the Code occupies 80% of the running time. In this way, you can first use tools such as benchmark to see if the software is too slow to endure, and then use profiler to find out where the problem is and where the bottleneck is, then you can use C to solve the key code.

This saves development time (most of the Code is written in python and faster than C), and the running speed is satisfactory. Therefore, there is no need to worry about the speed of python. But for the sake of objectivity, python is slow. In python, everything is an object. This is worse than a less pure OO language like java.

This is mainly because python is dynamic, so the lack of static type checks makes it difficult to find errors in the program. The settings may indicate that the syntax of the unexecuted block is not thoroughly checked. The variable is not declared, so it is prone to write errors by mistake. Is it really so bad?

The first lack of type check means that a function has several parameters, but because the parameter type is dynamically determined, therefore, there is no way to check whether the input parameters and parameter tables match in static mode. The problem is that the function you write must be tested by yourself. Once a problem occurs, you can easily find the error. Dynamic typing is so flexible and easy to use, so it is worth the trouble.

This is always a problem. Misspelling of variable names is passed when values are assigned, because a new name binding is generated. So this can be found out. It must be found in the case of assignment, which is much better than that in basic.

In general, dynamic does not provide some static checks, but may conceal errors. However, the dynamic debugging convenience (for example, the ability to find the wrong line from the error information at a glance, and the call process) is enough to offset the side effects.

  1. Python source code compilation skills
  2. Simple and Easy-to-use Python tools
  3. Introduction to the Python application field
  4. Python Android Object-Oriented Programming-Python applications
  5. How to Use the Python module to parse the configuration file?

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.