1 / 7

Python Interpreter

https://pythongeeks.org/interpreter-in-python/

Sudhanshi
Download Presentation

Python Interpreter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PYTHON INTERPRETER IN THIS ARTICLE, WE WILL LEARN ABOUT THE PYTHON INTERPRETER, AND HOW IT WORKS. AND ALSO GET INTRODUCED TO ITS ENVIRONMENT BY CODING. pythongeeks.org

  2. WHAT IS AN INTERPRETER? An Interpreter is a program that converts the code a developer writes into an intermediate language, called the byte code. It converts the code line by line, one at a time. It translates till the end and stops at that line where an error occurs, if any, making the debugging process easy. Python and Java are two examples of interpreted programming languages.

  3. WHAT HAPPENS WHEN YOU RUN PYTHON CODE? On running a Python code, say a simple program that prints “Hello, World!”, then the following steps happen: 1. The program gets converted into an intermediate code, called bytecode. This is also binary but is not understood by the processor. 2. Python Interpreter, stored in the memory as a collection of instructions in binary form, does the above conversion. These instructions can be thought of as a combination of a compiler and a Python Virtual Machine (PVM). 3. The compiler converts the source code, the “Hello, World!” program, into the byte code, which is platform-independent and understood by the PVM. 4. PVM reads the byte code and executes it on the hardware, the job of a processor.

  4. Python interpreter works

  5. FEATURES OF PYTHON INTERPRETER THE PYTHON INTERPRETER IS USER FRIENDLY AND ITS FEATURES INCLUDE: INTERACTIVE EDITING USE OF VARIABLES INITIALIZED IN THE PREVIOUS PROMPTS WRITING THE COMPLETE CODE IN IT WITH A READLINE FACILITY. TO GET COMMAND-LINE EDITING, ONE CAN PRESS CTRL+P, WHICH GIVES A BEEP INDICATING THE MODE IS ACTIVATED.

  6. GETTING STARTED WITH THE PYTHON INTERPRETER To open the Python interpreter, installed in the system, search in the Start menu. Then click on Python 3.9 or another, depending on the installed version. In Windows, it looks like Command Prompt. And on Mac, it looks like a terminal. The interpreter environment works using REPL: Read the lines of the code Evaluate and execute the code Print the output of the code (if any) to the console Looping to repeat the above process The picture below shows the Python interpreter once opened. Small description of the Python version, storage, etc. Along with this, you can see three arrows (>>>), called prompt.

  7. CONCLUSION HENCE, WE LEARNED THAT PYTHON IS AN INTERPRETER LANGUAGE AND HOW THE CODE IS EXECUTED INTERNALLY. WE ALSO GOT OUR HANDS DIRTY WITH SOME CODING IN AN INTERPRETER AND GOT FAMILIAR WITH ITS ENVIRONMENT. pythongeeks.org

More Related