Python_day1

Background:

I am totally a layman of python. Of course I know it is a programming language and it is popular. There are millions and millions people who can use python in the world but for me. I have to learn it immediately because I have no time to wait and to waste.

Beginning

Today I downloaded the Python_3.8 and installed it. This task is easy.
I followed the instruction from Liaoxuefeng https://www.liaoxuefeng.com/wiki/1016959663602400 and read a python book named Snake Wrangling for Kids. I suppose I am a kid too in this filed.

image.png

I guess the 2nd file Python 3.8(64-bit) is the python interpreter. that is where we write the Python code and run it.

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.

Well, my python interpreter is a CPython interpreter.
The following paragraph describes how a Python interpreter works. I can't understand it completely now but one day I will.

What happens when you run a 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.

Interactive mode is a command line shell which gives immediate feedback for each statement, while running previously fed statements in active memory. As new lines are fed into the interpreter, the fed program is evaluated both in part and in whole. Interactive mode is a good way to play around and try variations on syntax.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容