Python can be used for both front-end and back-end development. Python is a computer programming language that can be used for front-end and back-end development. It is a high-level scripting language that combines interpretation, compilation, interactive and object-oriented scripting; Python can be used for web application development and automated operations. Development of dimensions, artificial intelligence, web crawlers, scientific computing, etc.
The operating environment of this tutorial: windows7 system, python3 version, DELL G3 computer
python can be used for both front-end development and in back-end development.
Python is a high-level scripting language that combines interpreted, compiled, interactive, and object-oriented scripting. Python is designed to be highly readable. Compared to other languages, English keywords are often used, as well as some punctuation marks found in other languages. It has a more unique grammatical structure than other languages.
Python is a computer programming language that can be used for both front-end and back-end development. Python can be used for both front-end and back-end development; but python is mainly used for back-end development.
Python Features:
Easy to learn: Python has relatively few keywords, simple structure, clear syntax, and is relatively easy to learn.
Easy to read: Python code is more clearly defined.
Easy to maintain: Python’s success lies in its source code being fairly easy to maintain.
Rich standard library: One of the strengths of Python is its rich library, cross-platform, and good compatibility on UNIX, Windows, and Macintosh.
Interactive mode: Interactive mode support, you can enter the language to execute code and get the results from the terminal, interactive testing and debugging code snippets.
Portable: Based on its open source nature, Python has been ported to many platforms.
Scalability: If you need a key piece of code to run fast, or want to write some algorithms that you don’t want to open, you can use C or C to complete that part of the program, and then start from your Python program.
Application fields of Python
1. Web application development
On the Web In the world of development, Python is definitely a rising star. Although PHP and JS are still the mainstream languages for web development, Python is rising rapidly. Especially as Python's web development frameworks gradually mature (such as Django, Flask, Tornado, Web2py, etc.), programmers can more easily develop and manage complex web programs.
Figure 1: Python Web Development Framework
To give the most intuitive example, Google, the world's largest search engine, extensively uses the Python language in its online search system. In addition, Douban (shown in Figure 2), which we often visit and integrates movies, reading, and music, is also developed using Python.
Figure 2: Douban implemented in Python
Not only that, the world’s largest video website Youtube and Dropbox (a network file synchronization tool) also use Implemented in Python.
2. Automated operation and maintenance
The so-called automated operation and maintenance actually means using some open source automation tools to manage servers, such as the popular Ansible (based on Python) in the industry, which can help Maintenance engineers solve repetitive tasks.
As a scripting language, Python provides many software packages that facilitate interaction with the server. For example, the Python standard library contains multiple libraries that can be used to call operating system functions.
For example, through the pywin32 package, we can access Windows COM services and other Windows APIs; using IronPython, we can directly call the .Net Framework.
Generally speaking, system management scripts written in Python are better than scripts written in shell language in terms of readability, performance, code density and scalability.
3. Artificial Intelligence Field
Artificial intelligence is a very hot research direction at present. If you want to select the most popular and highest-paying IT positions, then it must be an engineer in the field of artificial intelligence. genus.
The core of artificial intelligence is machine learning. Machine learning research can be divided into traditional machine learning and deep learning. Both of them are widely used in image recognition, intelligent driving, intelligent recommendation, natural language processing and other applications. direction.
Among many programming languages, Python is definitely the language of choice for artificial intelligence. This is because Python has outstanding advantages in machine learning and deep learning. It can be said that artificial intelligence can no longer do without the support of Python. The reasons are summarized as follows:
Currently, the world’s excellent artificial intelligence learning frameworks, such as Google’s TransorFlow (neural network framework), FaceBook’s PyTorch (neural network framework), and the open source community’s Karas neural network library, are all used Implemented in Python;
Microsoft's CNTK (Cognitive Toolkit) also fully supports Python, and VS Code developed by the company also supports Python as a first-level language;
Python is good at scientific calculations and data analysis, supports various mathematical operations, and can draw higher-quality 2D and 3D images.
In short, the advent of the AI era has made Python stand out. Python’s position as the leading language in the AI era is basically unshakable!
4. Web crawler
The Python language has been used to write web crawlers for a long time. Search engine companies such as Google heavily use the Python language to write web crawlers.
From a technical perspective, Python provides many tools for writing web crawlers, such as urllib, Selenium and BeautifulSoup, etc. It also provides a web crawler framework Scrapy.
5. Scientific Computing
Since 1997, NASA has used Python extensively to perform various complex scientific operations.
And, compared with other interpreted languages (such as Shell, JS, PHP), Python has quite complete and excellent libraries in data analysis and visualization, such as NumPy, SciPy, Matplotlib, pandas, etc. This It can meet the needs of Python programmers to write scientific computing programs.
6. Game development
Many games use C to write high-performance modules such as graphics display, and use Python or Lua to write the game logic. Compared with Python, Lua has simpler functions and smaller size; while Python supports more features and data types.
For example, the more famous games Sid Meier's Civilization (Civilization, as shown in Figure 3) and EVE (Star Wars Eve) were developed using Python.
Figure 3: Using Python for game development
In addition, Python can directly call Open GL to achieve 3D rendering, which is the technical basis for high-performance game engines . In fact, there are many game engines implemented in the Python language, such as Pygame, Pyglet, and Cocos 2d.
The above is only an introduction to the "tip of the iceberg" in the application field of Python. In fact, we can also use PIL and other tools for image processing; use the PyRo toolkit for robot control programming, etc. Interested readers can search for information on their own to learn more.
【Related recommendations: Python3 video tutorial】
The above is the detailed content of Is python front-end or back-end?. For more information, please follow other related articles on the PHP Chinese website!