Python (Part 2)

5Arz...2PCy
13 Mar 2024
8

📚Chapter:1 Introduction: What is Python?
Section

Python History
What is Python?
How Does the Python Interpreter Work

1- Python History

The first appearance of the Python programming language was in late 1980s. It was created by Guido van Rossum in 1989 while working at National Research Institute in the Netherlands. [2]. Python was designed to replace the ABC programming language which worked with Amoeba operating system. Rossum started the implementation in 1989 and he worked on Python alone until 2018. He named it Python because the first version of it was able to read the BBC comedy script “Monty Python’s Flying Circus”. The first release was in 1994 under version 1.0 (Python 1.0) and the second release was in 2000, named version 2.0. In version 2.0, van Rossum added minor features such as collection systems and comprehensions. The third version was released in 2008 and fixed a basic flaw of the language. They named this version “Py3K”, or Python 3.0.[2]

2-What is Python?

Python is a high-level programming language designed to do many tasks. It’s based on the CPython interpreter which translates the Python code into something the machine can read [2]. Python gives us the ability to use a lot of modules and packages with our code, which are standard libraries built-in with the interpreter [2]. Python is a very simple language and has a very straightforward syntax. It encourages programmers to program without boilerplate (prepared) code. There are two major Python versions, Python 2 and Python 3. Python 2 and 3 are quite different. The Python 3 is more semantically correct and supports newer features. Python is a high-level programming language that Google, Facebook, NASA, and almost all other multinational companies worldwide use. Python has overtaken every language in recent years and has become the most popular and widely used programming language globally. Its popularity on the job market has grown to the extent that companies have made Python a requirement in their job postings. According to the Times of India, Python was among the top 5 highest-paid programming languages in 2021. But what exactly is Python, and why has it suddenly become such a sought-after language?
Python is a high-level, interpreted language that does not require a compiler, unlike other programming languages such as Java and C++. Python code is stored in a .pyc file, which serves as the Python engine and eliminates the need for a compiler. While many people assume the name Python Programming comes from something related to the Python snake, it actually comes from the TV comedy series ‘Monty Python’s Flying Circus.’ This series was broadcast on the BBC channel in the United Kingdom in the 1970s and was a favorite of Guido Van Rossum’s. Because it was short, cryptic, and included the name of his favorite TV comedy show, he chose the name ‘Python.’Python is one of the few programming languages that has been designated as an official Google language. Python became one of Google’s official programming languages due of its efficiency. It was advantageous to them because it is simple to use, even on large projects. Even YouTube is powered by Python programming.
Python is an interpreted, object-oriented programming language created by Guido van Rossum in 1991. Python can be used for everything from web development to Machine learning, Artificial intelligence, and Data Science. Unlike some other programming languages, Python does not require you to worry about syntax. Writing in Python is almost equal to written English. You have to use the proper functions or “modules” and let Python do the rest. The easy syntax of Python makes it great for beginners who are learning how to code and seasoned developers who want to quickly create software prototypes and earn a reasonable amount of income. Without wasting further time, let us get into the real business. Python is one of the most popular programming languages and it has replaced many languages in the industry. There are various reasons for its popularity and one of them is that python has a large collection of libraries [3].

3-How Does the Python Interpreter Work

The Python interpreter is called “CPython” and it’s written in the C programming language. This is the default implementation for Python. In the following sections, you will understand how the Python interpreter works behind the scenes. [2]

Source Code Analysis

Actually, any translator starts with the source code analysis. Here the Python interpreter receives the source code and initializes some instructions to do the following things: It follows the indentation rule and checks the Python syntax. Maybe there are some incorrect lines, so it will stop the program from executing to show the error message. This phase is called lexical analysis, which means dividing the source code files into a list of tokens In the following step, the interpreter will generate byte codes. Let’s see how that works.
Byte Code Generation
Once the parser of the Python interpreter receives the tokens, it starts to manipulate the lexical tokens. It generates a big structure called the AST (Abstract Syntax Tree). The interpreter converts this AST to byte code which means machine language. In Python, the byte code can be saved in a file ending with the “.pyc” extension. In the following section, you will see how the Python interpreter executes these byte codes.
The Python Virtual Machine (PVM)
The Python interpreter initializes its runtime engine called PVM which is the Python virtual machine. The interpreter loads the machine language with the library modules and inputs it into the PVM. This converts the byte code into executable code such as 0s and 1s (binary). And then it prints the results. Note that if an error happens during the PVM process, the executor will terminate the operation immediately to display the error. Now you will learn how to install Python on your operating system. If you have no Python software or you’re using a mobile device, you can use any online Python compiler.

Please Follow coursesteach to see latest updates on this story

If you want to learn more about these topics: Python, Machine Learning Data Science, Statistic For Machine learning, Linear Algebra for Machine learning Computer Vision and Research
Then Login and Enroll in Coursesteach to get fantastic content in the data field.
Stay tuned for our upcoming articles where we will explore specific topics related to Python in more detail!
Remember, learning is a continuous process. So keep learning and keep creating and Sharing with others!💻✌️
More update about Python Please follow and enroll:
Course: Introduction of Python
📚GitHub Repository
📝Notebook

References

1- 8 Interesting Facts About Python Programming Language
2-What is Python? How the Interpreter Works and How to Write “Hello World” in Python
3- Top 30 Python Libraries for Machine Learning




Get fast shipping, movies & more with Amazon Prime

Start free trial

Enjoy this blog? Subscribe to Josna Akter

0 Comments