A brief introduction of Python

Python is a programming language written by Guido van Rossum, the famous "turtle uncle", to beat the boredom of Christmas in 1989.

There are now more than 600 programming languages in the world, but only about 20 are popular. If you've heard of the TIOBE rankings, you can get an idea of the general popularity of programming languages. Here's a graph of the 10 most commonly used programming languages over the last 10 years:

In general, each of these programming languages has its own strengths. C language can be used to write operating systems close to the hardware of the language, so it is suitable for the development of those who pursue the running speed, the full performance of the hardware of the program. Python is a high-level programming language for writing applications.

When you start to do real software development in a language, you need a lot of basic off-the-shelf stuff to help you speed up development, in addition to writing code. For example, to write an E-mail client, if you start at the bottom and write code related to the network protocol, you probably won't be able to develop it in a year or so. High-level programming languages usually provide a fairly complete base code base that you can call directly, for example, SMTP libraries for E-mail protocols, GUI libraries for desktop environments, based on these existing code bases, an E-mail client can be developed in a few days.

Python provided us with a very complete basic code base, covering a large number of contents such as network, files, GUI, database, text, etc., which was figuratively called "batteries included". In Python, many features are not written from scratch, but are written off the shelf.

In addition to the built-in libraries, Python also has a large number of third-party libraries that are developed by others for you to use directly. Of course, if your code is well encapsulated, it can also be used as a third-party library.

Many large websites are developed in Python, such as YouTube, Instagram and domestic douban. Many large companies, including Google, Yahoo, and even NASA, use Python a lot.

Turtle uncle to Python positioning is "elegant", "clear", "simple", so Python programs always look simple and easy to understand, beginners to learn Python, not only easy to get started, but also in the future, deep enough to write those very, very complex programs.

In general, Python's philosophy is to be simple and elegant, to write as much code as possible that is easy to read and as little as possible. If an experienced programmer shows you that he writes code that is obscure and tens of thousands of lines at a time, you can laugh at him as much as you like.

So what types of applications is Python good for?

The first choice is the network application, including the website, the background service and so on;

Then there are the many gadgets that are needed on a daily basis, including the scripting tasks that system administrators need, and so on.

Another is the other language to develop the program packaging, easy to use.

Finally, the disadvantages of Python.

Every programming language has its drawbacks, and Python is no exception. Having said the advantages, what are the disadvantages of Python?

The first disadvantage is that it runs slowly, very slowly compared to C programs, because Python is an interpreted language, and your code is translated line by line into machine code that the CPU can understand, which is very time-consuming and therefore very slow. C programs are compiled directly into machine code that can be executed by the CPU before running, so they are very fast.

But a lot of applications don't need to run that fast because users don't feel it. For example, to develop a web application for downloading MP3, the running time of C program takes 0.001 seconds, while that of Python program takes 0.1 seconds, which is 100 times slower. However, because the network is slower, it takes 1 second to wait. Do you think users can feel the difference between 1.001 seconds and 1.1 seconds? This is similar to the formula 1 racing car and the ordinary taxi driving on the third ring road in Beijing, although the theory of formula 1 racing car speed up to 400 kilometers per hour, but the third ring road traffic jam is only 20 kilometers per hour, so, as a passenger, you will always feel 20 kilometers per hour.

8 replies to A brief introduction of Python

  1. These are in fact impressive ideas in regarding blogging.
    You have touched some nice factors here. Any way keep up wrinting.

Leave a Reply

Your email address will not be published. Required fields are marked *