We will see how to set up a coding environment for Python. Here’s a few things which we will require to get started.
1. Surprisingly we will need Python to be installed on our system.
Go to https://www.python.org/downloads/ and download the latest version of python. For windows you can download the graphical installer.
If you are on Linux you might already have python installed.
2. Correct way to get it done!
Now make sure you check this checkbox. It adds Python to the list of environment variables.
What are environment variables and why should Python be added into it?
Environment variables are like contacts on your phone. The name of your contact is the way you remember it, but what actually matters is the number associated with that name. Environment variables are names of file locations. This way you don’t need to remember “C:\Users\Laptop\something\abracadabra”, you can simply remember the name of variable holding this file path. One more thing, environment variables are mostly useful for the operating system.
To access the environment variables
Search “This PC” -> Right click on it and go to properties -> Click on “Advanced system settings” -> That’s it.
If Python isn’t added into environment variable, you won’t be able to globally access it from command line / Powershell ( or just won’t be able to access it outside of it’s directory ) and you will get an error like this.
3. Let’s test our installation.
To test if Python is installed correctly, simply open cmd or powershell. Type python and hit enter. You will see an output like above.
4. But where to write the sassy code?
Well you can write code in notepad file, save it with .py extension and run it from command prompt with
But what’s fun in that. There are tons of IDEs (Integrated Development environments) where you can code like a pro.
What I prefer is Visual Studio Code. It’s free, have tons of extensions and the color themes are amazing.
If you want to learn Python. Keep reading this series. 🚀
If you are a person who prefers learning from video more than reading books, check out my Udemy Course.