python0.2----How to execute a python script below the cmd window

Source: Internet
Author: User
Tags python script

①. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.