①. To download a good Python environment, we recommend that you use version 3.6
②. The path to the Python installation needs to be recorded at the time of installation, such as the path of my Computer Python.exe installation: C:\Users\yuliang\PycharmProjects\word_game_1\venv\ Scripts, add the path to the system's environment variable path.
③: Open the cmd window and type the python command directly, if any
Python 3.6.5 (V3.6.5:F59C0932B4, Mar 2018, 16:07:46) [MSC v.1900 + bit (Intel)] on Win32
Type "Help", "copyright", "credits" or "license" for more information.
The word, stating that the environment is configured correctly, in the future no matter what the cmd under the directory, only need to type Python, the system can automatically find Python.exe.
④: Find the Python script to run, find its path, for example, one of my scripts hello.py's path is C:\Users\yuliang\Desktop\Project
Type the CD C:\Users\yuliang\Desktop\Project command in CMD, go to the directory, and type Python hello.exe, and the script will execute correctly.
Note: The path of Linux and the Windows path is different, Linux is used/, Windows uses \
You can drag a file directly inside the cmd window, where the cmd window displays the directory and the file name
Several commands:
dir: View all files in the current directory.
CD.. : go to the previous level directory.
python0.2----How to execute a python script below the cmd window