How to Change Environments in Python
From the Windows command prompt, you can change the Python environment in which you want to run your script. You use the environment command arguments when you execute and call the Python script from the command prompt. This lets you test the Python script without running the entire program, or you can test argument variables passed to the Python functions and modules.
Instructions
-
-
1
Click the Windows "Start" button and type "cmd." Press "Enter" to launch the Windows command-prompt window.
-
2
Type "cd folder," substituting the location of the Python script that you want to run for "folder." Press "Enter" to move the prompt to the Python script location.
-
-
3
Type "python script.py -s environment command" where "environment command" is the command you want to run with the script. Replace "script.py" with the name of your own script file. Press "Enter" to run the command on the computer.
-
1