Python基础---如何运行Python程序?(How to Excute a python programe?)

如何运行Python程序?(How to Excute a python programe?)

一些概念(Concept)

  • Python Interpreter

    • The Python interpreter can run Python programs that are saved in files or interactively execute Python statements that are typed at the keyboard. [1]
    • The Python interpreter is a program that can read Python programming statements and execute them. [1]
  • IDLE

    • Python comes with a program named IDLE that simplifies the process of writing, executing, and testing programs. [1]
  • IDE

    • Integrated DeveLopment Environment. [1]
    • IDE is a single program that gives you all of the tools you need to write, execute, and test a program. [1]
  • Python Shell

    • When the Python interpreter is running in interactive mode, it is commonly called the Python shell. [1]

运行Python程序操作(Excuting python statements or python programs)

  • Two modes: Interpreted mode and Script mode.
  • Interpreted mode:
    • 操作环境:win10家庭中文版,Python 3.7.3
    • Command Line:
    1. Open the OS’s Command Line;
    2. 【python】
    3. type your command:Python基础---如何运行Python程序?(How to Excute a python programe?)_第1张图片
    • IDLE:
    1. Open IDLE
    2. type your command:Python基础---如何运行Python程序?(How to Excute a python programe?)_第2张图片
  • Script mode
    • 操作环境:win10家庭中文版,Python 3.7.3
    • Command Line:
    1. create a python file, like HelloWorld.py
    2. go to the directory in which the file is saved
    3. type your command:
      在这里插入图片描述
    • IDLE:
      • 【file】-【open】- open the python file
      • run module 【F5】
        Python基础---如何运行Python程序?(How to Excute a python programe?)_第3张图片
        在这里插入图片描述
        参考文献
        [1] Tony Gaddis,Starting Out with Python[M],United Kingdom: Pearson,2019

你可能感兴趣的:(Python)