Home >Backend Development >Python Tutorial >How to execute py file

How to execute py file

angryTom
angryTomOriginal
2020-02-13 12:37:0016812browse

How to execute py file

How to execute the py file

1. First, copy the path where the py file is stored in the resource manager, and press the Windows key + r. Enter cmd in run and press Enter to open the command line:

How to execute py file

#2. In the command line, first switch to the path of the py file, and then enter "python file name. py "Run the python file:

Recommended learning: Python video tutorial

How to execute py file

3. Press the Enter key and you can see The py file in the window starts to run. Note that when running the py file on the command line, you must add the python installation path to the environment variable path, otherwise an error will be reported and the command cannot be found. At this point, the operation of running the file in python is completed:

How to execute py file

The above is the detailed content of How to execute py file. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn