In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
It is believed that many inexperienced people have no idea about the origin and language characteristics of python. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
I. 1.1What is Python
Python is an elegant and robust programming language, which not only inherits the strength and versatility of traditional compiled languages, but also draws lessons from the ease of use of simple scripts and interpretive languages. It can help you finish your work, and after a period of time, you can still read this piece of code you wrote. You will be surprised that you have learned it and its powerful functions so quickly, not to mention the work you have already done! Only you can't think of it. You can't do it without Python.
II. 21.2 Origin
Guido van Rossum founded Python at the end of 1989, when he was at CWI (Centrum voor Wiskunde en Informatica, the National Institute of Mathematics and computer Science) in the Netherlands. In early 1991, Python released its first public release. How on earth did it all begin? Like C, C++, Lisp, Java, and Perl, Python comes from a research project in which programmers work hard with the tools at hand, conceiving and developing better solutions.
Van Rosam was a researcher at the time and had extensive design experience with the interpretive language ABC, which was also developed in CWI. But he is not satisfied with his limited development capacity. After using and participating in the development of a high-level language like ABC, it is obviously impossible to fall back to the C language. Some of the tools he expects are for day-to-day system administration tasks, and it also wants to be able to access system calls to the Amoeba distributed operating system. Although Van Rotham thought of developing a special language for Amoeba, it was obviously wiser to create a general-purpose programming language, so in late 1989, the seeds of Python were planted.
III. 31.3 characteristics
Although Python has been popular for more than 15 years, some people still think that it is still a newcomer to the general software development industry. We should be careful to use the word "relative", because the program development of the "network age" has been seen for several years.
It looks like decades. When people ask, "what is Python?" It is difficult to describe it with any concrete representation. People are more likely to say all their feelings about Python without thinking. Python is _ (please fill in) _ _. What are these characteristics? In order to let you know why, we will explain these features one by one.
1.3.1 Advanced
With the emergence of each generation of programming languages, we will reach a new level. Assembly language is God's gift to those who struggle with machine code, and then came FORTRAN, C, and Pascal, which took computing to new heights and created the software development industry. With the birth of C language, more and more modern compiled languages such as C++ and Java have been born. We don't stop there, so we have powerful interpretive scripting languages that can make system calls, such as Tcl, Perl, and Python.
These languages have high-level data structures, which reduces the time required for the development of previous "frameworks". Lists (variable size arrays) and dictionaries (hash tables) in Python are built into the language itself. Providing these important building units in the core language can encourage people to use them, shorten development time and code volume, and produce more readable code. In the C language, there is no corresponding standard library for hybrid arrays (lists in Python) and hash tables (dictionaries in Python), so they are often implemented repeatedly and copied to each new project. The process is chaotic and error-prone. C++ uses a standard template library to improve this situation, but the standard template library can hardly compare with the simplicity and readability of Python's built-in lists and dictionaries.
1.3.2 object-oriented
Suggestion: object-oriented programming adds new vitality to structured and procedural programming with the separation of data and logic. Object-oriented programming supports the combination of specific behaviors, features, and / or functions with the data they want to process or represent.
The object-oriented nature of Python is innate. However, Python does not want Java or Ruby to be just an object-oriented language. In fact, it combines a variety of programming styles. For example, it even borrows from some features of functional languages like Lisp and Haskell.
1.3.3 upgradeable
Python is often compared to shell in batch or Unix systems. Simple shell scripts can be used to handle simple tasks, even though they can grow in length (indefinitely), but the functionality is always exhausted. The code reuse of Shell scripts is very low, so you can only stop at small projects. In fact, even small projects can lead to smelly and long scripts. This is not the case with Python. You can constantly refine your code in various projects, add additional new or existing Python elements, or reuse code in your mind. Python promotes concise code design, advanced data structures, and modular components that allow you to increase the scope and size of your project while ensuring flexibility, consistency, and reducing the necessary debugging time. The term "upgradeable" is most often used to measure the load of hardware and usually refers to the performance improvement brought about by the addition of new hardware to the system. We are happy to distinguish this quoting concept here, and we try to use "scalable" to convey the idea that Python provides basic development modules on which you can develop your software, and when these need to expand and grow, Python's pluggable and modular architecture can make your project vibrant and easy to manage.
1.3.4 Extensible
Even if you have a large amount of Python code in your project, you can still organize and manage it methodically by splitting it into multiple files or modules. And you can select code from one module and read properties from another module. Even better, the access syntax for Python is the same for all modules. Whether this module is from the Python standard library or you created it a minute ago, even an extension you wrote in another language is fine! With these features, you will feel that you have "extended" the language as needed, and you have already done so. The bottleneck in the code, which is always at the top of the list in performance analysis, or where performance is particularly emphasized, can be rewritten in C as a Python extension. . It is important to reiterate that these interfaces are exactly the same as those of pure Python modules, and even the access methods of code and objects are the same. The only difference is that this code brings a significant improvement in performance. Naturally, it all depends on your application and its resource requirements. In many cases, it is definitely beneficial to use compiled code to rewrite the bottleneck of the program, because it can significantly improve overall performance.
This extensibility in the programming language allows engineers to flexibly attach or customize tools and shorten the development cycle. Although mainstream third-generation languages (3GL) like C, C++, and even Java have this feature, it is really an advantage of Python to write extensions in C so easily. In addition, there are tools like PyRex that allow mixed programming of C and Python, making it easier to write extensions because it converts all code into C code. Because the standard implementation of Python is done in C (that is, CPython), you write Python extensions in C and C++. The Java implementation of Python is called Jython, and its extensions are written in Java. Finally, there is IronPython, which is a C # implementation for .NET or Mono platforms. You can use C # or VB.Net to extend IronPython.
1.3.5 portability
Python can be seen on a variety of systems, which is due to the sustained and rapid growth of Python in today's computer field. Because Python is written in C, and because of the portability of C, Python can run on any platform with ANSI C compiler. Although there are some unique modules developed for different platforms, general software developed with Python on any platform can be slightly modified or run intact on other platforms. This portability applies to both different architectures and different operating systems.
1.3.6 easy to learn
Python has few keywords, simple structure and clear syntax. This makes it easier for learners to get started in a relatively short time. What may feel new to beginners may be the object-oriented features of Python. Those who are not fully proficient in OOP (Object Oriented Programming, object-oriented programming) have some scruples about using Python directly, but OOP is not mandatory or mandatory. Getting started is also very simple. You can dabble in it a little bit and wait until you are ready to use it.
1.3.7 easy to read
Python differs significantly from other languages in that it does not have the imperative symbols that other languages typically use to access variables, define code blocks, and perform pattern matching. Usually these symbols include: dollar sign ($), semicolon (;), tilde (~), and so on. Without these distractions, Python code becomes clearer and easier to read. To the dismay (or relief) of many programmers, unlike other languages, Python doesn't give you much opportunity to write obscure code, but allows others to quickly understand your code, and vice versa. As mentioned earlier, the readability of a language makes it easier to learn. We even venture to claim that even for those who haven't seen a line of Python code before, that code is fairly easy to understand.
1.3.8 easy maintenance
Source code maintenance is an integral part of the software development life cycle. Your software will usually continue to be redeveloped as long as it is not replaced or abandoned by other software. This is usually much longer than a programmer's time in a company. The success of the Python project is largely due to the ease of maintenance of its source code, depending on the length and complexity of the code. However, it is not difficult to come to this conclusion because Python itself is easy to learn and read. Another exciting advantage of Python is that you don't confuse yourself when you read a script you wrote six months ago, and you don't need a reference manual to understand your software.
1.3.9 robustness
There is nothing more effective than allowing programmers to provide a handling mechanism based on error conditions when an error occurs. Python provides a "safe and reasonable" exit mechanism for errors, allowing programmers to take control of the situation. Once your Python crashes due to an error, the interpreter will send out a "stack trace" with all the information available, including the reason why your program crashed and that code (file name, number of lines, line calls, etc.) went wrong. These errors are called exceptions. If such errors occur at run time, Python enables you to monitor them and handle them. These exception handling can take appropriate actions, such as resolving the problem, redirecting the program flow, performing cleanup or maintenance steps, shutting down the application normally, or simply ignoring it. In any case, this can effectively reduce the debugging process in the development cycle. The robustness of Python is of great help to both software designers and users. Once some errors are mishandled, Python can also provide some information, and the stack trace generated as a result of an error can not only describe the type and location of the error, but also
Can indicate the module in which the code is located.
1.3.10 efficient rapid prototyping development tool
We have already mentioned how easy Python is to learn and read. But, you may want to ask, the same is true of BASIC. What is so outstanding about Python? Unlike those closed and rigid languages, Python has many interfaces for other systems, and it is powerful enough and strong enough to use Python to develop a prototype of the entire system. Obviously, traditional compiled languages can also achieve the same system modeling, but the simplicity of Python workers allows us to do the same work in the same amount of time. In addition, a large number of extension libraries have been developed for Python, so no matter what kind of application you plan to develop, you may find forefathers. All you have to do is plug and play (and configure it yourself, of course)! As long as you can figure it out, Python modules and packages can help you achieve it. The Python standard library is complete, and if you can't find what you need in it, a third-party module or package will make it possible for you to get the job done.
1.3.11 memory Manager
The biggest drawback of C or C++ is that memory management is the responsibility of developers. So even for an application that rarely accesses, modifies, and manages memory, programmers must perform these duties in addition to performing basic tasks. These unnecessary burdens and responsibilities imposed on developers are often distracted. In Python, because memory management is the responsibility of the Python interpreter, developers can free themselves from memory transactions, focus on the most immediate goals, and focus only on the primary applications in the development plan. This results in fewer errors, more robust programs, and shorter development cycles.
1.3.12 interpretive and (byte) compilability
Python is an interpreted language, which means that there is no compilation in the development process. In general, purely interpreted languages usually run more slowly than compiled languages because they do not run in native machine code. However, similar to Java,Python, which is actually compiled in bytes, the result is an intermediate form similar to machine language. This not only improves the performance of Python, but also maintains the advantages of an interpreted language.
After reading the above, have you mastered the origin and language characteristics of python? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.