Getting Started with The Environment Setup
In this tutorial, we shall be looking upon how we can set up an environment which we will be using to run our Python codes.
Python is supported by mostly all the operating systems that is, windows, Unix, macOS, etc.
Let us look at some ways which we can use in order to operate Python in our system.
First, you need to install python on your computer. For that, you need to download Python. You can type python download in the google search engine. You will see an option by the name python.org which is the site where you can get information like codes, documentations, news etc. in short, you can get each and everything related to python on this website.
Over there, there plenty of options to choose from like whether you want to download for windows, Linux or for mac based on what you are working with. I will recommend you to go for the latest version, as it might be having some latest features of some improvements. After the download, your system now supports the use of Python. But where are we going to write the code?
For this, we have plenty of options available.
One of the ways is by using the command prompt/power shell of our system (for windows).
For that you need to open your command prompt or shell and need to set a path so that it knows from where it needs to fetch the data in order to run python programs.
Let us see how we can set the path for Python.
1) Open the command prompt
2) Over their type, path %path%; C:\programfiles\Python. After that press enter.
Here, we are mentioning the path as C:\programfiles\Python. This might be different in your case as you might have installed the Python somewhere else in your computer. Search for it and copy its location, then paste it in the command prompt. As I am working on windows so I will be using the commands for windows.
1) Open the bash shell
2) Over their type, export PATH =” $PATH:/usr/files/program/bin/python”. After that press enter.
Here, the location of the python directory is /usr/files/program/bin/python. You might have installed it at some other place so mention that here.
I hope that you guys were able to do it as it was not that difficult.
Let us look at how can we run our python code inside the command prompt or the shell.
After setting up of the path, open the command prompt and type python over there. As soon as you press enter, it will display the python version that you are using along with some instructions and information.
After following the above steps, this is the result that you will get (for windows).
Let us look at another way to run Python in your system.
You can install an IDE (Integrated Development Environment). It is a GUI (Graphical User Interface) environment that is eye pleasing, has a lot more to offer and is very interactive at the same time as it provides a lot of functionalities. We can use it for creating GUI’s. I personally like to use an IDE, but if you are not working on some large or complex projects, then you can use the command prompt. For basic learning command prompt is a good option as it does not require that much of installations and additions.
There are plenty of IDE’s to choose from you like:
b) Visual studio code
And many more.
I hope that you were able to set up the python environment on your system. If not, then go through the above-mentioned steps again. We will be starting with the coding portion soon in the coming tutorials so pull up your socks, get ready with your command prompt or IDE and let us code! Do check that it is working properly or not. See you guys in the next one.