In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to understand Python dynamic language, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Some people say that Python dynamic language is an explanatory language, but this is not true. In fact, Python is an object-oriented, literal translation computer programming language, and it is also a powerful and comprehensive general-purpose language. Python is definitely the choice for users of * times of contact programming.
But many people will use basic for a while and then dispose of it because they think there are too few functions except that it can be used for play. Even vb is not fully functional, and many places rely on components written in other languages and direct calls to api to complete the function. And python also looks like a toy at first glance. And the feeling of the teaching language brought by the interactive command line reinforces people's thinking.
But the function of Python can not be said to be weak, in fact, it is very powerful. Python has built-in functions such as important data structures and files, and contains a large standard library, which basically covers all kinds of functional requirements from GUI to database to network.
And there are many enthusiasts, companies write third-party libraries for python, these libraries have a wide variety and complete functions. And you can package libraries in other languages for your own use. It is also possible to write extended libraries directly in a language like c.
So python is as easy to learn as basic, but much more powerful. Python is very slow and can only be used in a few applications. For people who are used to languages like assembly and C++, there is always an inertia in thinking (including a stage I've been through myself).
Is to see that the file size is numeric section, any runtime overhead is absolutely not allowed. Then it is reasonable to see a dynamic language like python, which is very dynamic. The key question is, first of all, whether you need to save as much as 100,200k.
Today's memory, hard disk, and network communication environments don't care much about such a little space, so size is not a problem. Is it the running time that matters? In fact, in many situations, you don't need to be so fast, such as opening a window and running 100ms if you delay it. Can you feel it?
Python can also do some processing of py files into pyc files, speeding up the interpretation and execution of source files. Pre-read, pre-compiled techniques such as just in time or hot spot in java's virtual machine can be used equally for python.
Another great advantage of Python dynamic language is the ability to write extension modules in a fast language like C. In software, 20% of the code accounts for 80% of the running time. In this way, you can first use tools like benchmark to see if the software is unbearably slow, and then use profiler to find out where the bottleneck is, so you can solve the key code in C.
This saves development time (most of the code is written in python, which is faster than C), and runs satisfactorily. Therefore, there is no need to worry too much about the speed of python. But for the sake of objectivity, python is slow, and everything is an object in python, which is worse than a less pure OO language like java.
The main reason for this view is that because python is dynamic, there is a lack of static type checking, so errors in the program are difficult to find. Setting may say that the syntax of blocks that have not been executed have not been completely checked. Variables are prone to miswriting errors because they are not declared. Is it really that bad?
* lack of type checking means that a function has several parameters, but because the type of the parameter is determined dynamically, there is no way to check whether the passed parameter matches the parameter table when it is static. The problem is that the functions you write must be tested by yourself.
And if something goes wrong, it's very easy for you to find the wrong place. Dynamic typing is so flexible and easy to use that it's worth the trouble. The second view is wrong. All grammars are checked in python. Even in a branch statement. It's just possible that's what you're talking about.
For people who are used to languages like assembly and C++, there is always an inertia in thinking (including a stage I've been through myself). Is to see that the file size is numeric section, any runtime overhead is absolutely not allowed. Then it is reasonable to see a dynamic language like python, which is very dynamic.
The key question is, first of all, whether you need to save such a 100m 200k size, the current memory, hard disk, network communication environment does not care about such a little space, so size is not a problem. Is it the running time that matters? In fact, in many situations, you don't need to be so fast, such as opening a window and running 100ms if you delay it. Can you feel it?
Python dynamic language can also transform py files into pyc files through some processing, speeding up the interpretation and execution of source files. Pre-read, pre-compiled techniques such as just in time or hot spot in java's virtual machine can be used equally for python.
Another great advantage of python is the ability to write extension modules in a fast language like C. In software, 20% of the code accounts for 80% of the running time. In this way, you can first use tools like benchmark to see if the software is unbearably slow, and then use profiler to find out where the bottleneck is, so you can solve the key code in C. This saves development time (most of the code is written in python, which is faster than C), and runs satisfactorily.
The above is how to understand Python dynamic language, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.