Home  >  Article  >  Backend Development  >  How to run py file in python

How to run py file in python

coldplay.xixi
coldplay.xixiOriginal
2021-03-02 16:12:0576089browse

How to run py file in python: First copy the path where the py file is stored in the resource manager, and open the command line; then switch to the path of the py file; then enter "python file name.py" ; Finally, press the Enter key, and you can see that the py file in the window starts to run.

How to run py file in python

The operating environment of this tutorial: Windows 7 system, python version 3.9, DELL G3 computer.

How to run py files in python:

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

How to run py file in python

2. In the command line, first switch to the path of the py file, then enter "python filename.py" to run python file:

How to run py file in python

3. Press the Enter key and you will see that the py file in the window starts to run. Note that when running the py file on the command line, you need to change the python installation path. Add it 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 python file is completed:

How to run py file in python

Related free learning recommendations: python video tutorial

The above is the detailed content of How to run py file in python. 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