Python is an example of high-level language. As you might infer from the name “high-level language”, there are also low-level languages, sometimes referred to as “machine languages” or “assembly languages”. Loosely speaking, computers can only execute programs written in low-level languages. So programs written in a high-level language have to be processed before they can run. This extra processing takes some time, which is a small disadvantage of high-level languages.

But the advantages are enormous. First, it is much easier to program in a high-level language. Programs written in a high-level language take less time to write, they are shorter and easier to read, and they are more likely to be correct. Second, high-level languages are portable, meaning that they can run on different kinds of computers with few or no modifications. Low-level programs can run on only one kind of computer and have to be rewritten to run on another.

Due to these advantages, almost all programs are written in high-level languages. Low-level languages are used only for a few specialized applications.

Two kinds of programs process high-level languages into low-level languages: interpreters and compilers. And interpreter reads a high-level program and executes it, meaning that it does what the programs says. It processes the program a little at a time, alternately reading lines and performing computations.

A compiler reads the program and translates it completely before it starts running. In this case, the high-level program is called the source code, and the translated program is called the object code or the executable. Once a program is compiled, you can execute it repeatedly without further translation.

Python is considered an interpreter language because python is executed by an interpreter. There are two ways to use the interpreter: interactive mode and script mode. By convention, python scripts have names that end with .py.

Working in interactive mode is convenient for testing small pieces of code because you can type and execute them immediately. But for anything more than a few lines, you should save your code as a script so you can modify and execute it in future.

From Thinking in Python

最新文章

  1. 深入理解DOM事件类型系列第三篇——变动事件
  2. Java分布式Socket监控项目思考
  3. windows Azure 域名绑定
  4. 使用Astah繪製UML圖形(转)
  5. 基础学习总结(七)--子线程及Handler
  6. poj 3740 Easy Finding 二进制压缩枚举dfs 与 DLX模板详细解析
  7. SQLite数据插入异常
  8. linux下登陆用户的行为信息—w和who命令详解
  9. nginx redis tomcat 分布式web应用 session共享
  10. dom+bom
  11. PHP学习路径
  12. DataTable排序(来自其他空间)
  13. Quartz 2D官方文档翻译(持续更新中)
  14. 第一篇:使用Spark探索经典数据集MovieLens
  15. 3.C++内联函数,默认参数,占位参数
  16. SIFT解析(三)生成特征描述子
  17. 配置SharePoint环境加域提示网络名不可用[已解决]
  18. BUAA-OO-第一单元总结
  19. java 中的interface是否继承object
  20. Charles抓包基本用法

热门文章

  1. 华硕 X201E 拆机
  2. 使用malloc分别分配2KB的空间,然后用realloc调整为6KB的内存空间,打印指针地址
  3. java mail邮件发送(带附件) 支持SSL
  4. Transformation in kentico
  5. nyoj--55--懒省事的小明(STL优先队列)
  6. APACHE KYLIN™ 概览(分布式分析引擎)
  7. html5+css3+javascript 自定义弹出窗口
  8. Java获取环境变量和系统属性
  9. 蛋白质GO信息的一些数据库
  10. (转载) Android-Spinner的使用以及两种适配器