Use Python in CMD - Here's how
In this practical tip, we will show you how you can use Python in CMD by editing the environment variables.
Use Python in CMD - Here's how
In the following we would like to show you how you can use Python in CMD. To do this, you must first change the environment variables. You can also see all the steps in the picture gallery at the end of the article.
- Open Windows Explorer and right click on your PC. Then select "Properties".
- Then click on "Advanced system settings".
- Then click "Environment Variables".
- Select "Path" for the user variables and click "Edit".
- Add a new environment variable by clicking "New". Enter the path to your Python system folder (e.g. "C: \ Users \ yourusername \ AppData \ Local \ Programs \ Python \ Python36").
- After that, you need to add another environment variable. This time, however, you have to use the path of the "Scripts" subfolder (eg "C: \ Users \ yourusername \ AppData \ Local \ Programs \ Python \ Python36 \ Scripts") of your Python system folder.
- Edit the "Path" system variables and add these two paths here as well.
- Now you can also use all Python commands in CMD.
Tip: You can find further programming tutorials on our Python programming language topic page. There we show you, for example, how you can define functions in Python.