SoFunction
Updated on 2024-11-17

Finding the Python installation directory, setting up environment paths, and running python scripts from the command line.

First point: find the Python installation directory

Method I:

Method II:

Type import sys

print()

blackened area

Point 2: Once you have found the installation directory you can start setting environment variables

Here my installation directory is C:\Program Files\Python36

At the end of the string, add a semicolon.

Then enter the path where you installed python, as shown here

Tap OK and OK all the way through until the setup is complete

Open the command line, type python, and the following prompt will appear to indicate successful configuration

One last thing: how to run python scripts from the command line

Provided that the setup has been completed as described above

Open the command line and drag the script file in and press enter

My script file is

Inside: print(100) (note the bracket format or the following error message will appear:)

Enter the correct case:

Above this find Python installation directory, set the environment path and in the command line to run python script example is all I share with you, I hope to give you a reference, and I hope you support me more.