zoukankan      html  css  js  c++  java
  • The python programing language

    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

     

  • 相关阅读:
    centos7.6进行软raid5制作
    面试题 PHP1
    基于githooks利用PHP_CodeSniffer做PSR2代码风格规范检测
    【GC 分代收集算法 VS 分区收集算法】
    【 Redis五大数据类型实现原理】
    【Java反射】
    【GC 垃圾收集器】
    【Redis过期策略/内存淘汰机制/对过期Key的处理】
    【Redis底层数据结构】
    【当骗子遇上研发工程师,还没开始就已经结束】
  • 原文地址:https://www.cnblogs.com/ryansunyu/p/3652518.html
Copyright © 2011-2022 走看看