如何运行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:
- Open the OS’s Command Line;
- 【python】
- type your command:
- IDLE:
- Open IDLE
- type your command:
- Script mode
- 操作环境:win10家庭中文版,Python 3.7.3
- Command Line:
- create a python file, like HelloWorld.py
- go to the directory in which the file is saved
- type your command:
- IDLE:
- 【file】-【open】- open the python file
- run module 【F5】
参考文献
[1] Tony Gaddis,Starting Out with Python[M],United Kingdom: Pearson,2019