Python 是解释的还是编译的,或者两者兼而有之? - Is Python interpreted, or compiled, or both?

10/14 06:12
阅读数 0

问题:

From my understanding:根据我的理解:

An interpreted language is a high-level language run and executed by an interpreter (a program which converts the high-level language to machine code and then executing) on the go;解释型语言是由解释器(将高级语言转换为机器代码然后执行的程序)在旅途中运行和执行的高级语言; it processes the program a little at a time.它一次处理一些程序。

A compiled language is a high-level language whose code is first converted to machine-code by a compiler (a program which converts the high-level language to machine code) and then executed by an executor (another program for running the code).编译型语言是一种高级语言,其代码首先由编译器(将高级语言转换为机器代码的程序)转换为机器码,然后由执行器(用于运行代码的另一个程序)执行。

Correct me if my definitions are wrong.如果我的定义有误,请纠正我。

Now coming back to Python, I am bit confused about this.现在回到 Python,我对此有点困惑。 Everywhere you learn that Python is an interpreted language, but it's interpreted to some intermediate code (like byte-code or IL) and not to the machine code.你到处都知道 Python 是一种解释型语言,但它被解释为一些中间代码(如字节码或 IL),而不是机器码。 So which program then executes the IM code?那么哪个程序执行IM代码呢? Please help me understand how a Python script is handled and run.请帮助我了解如何处理和运行 Python 脚本。


解决方案:

参考一: https://en.stackoom.com/question/SuKx
参考二: https://stackoom.com/question/SuKx
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部