Comprehensive Python

Table Of Contents:

Installing Python

Now that we know what python is, what we need to do by for now is to have python to run on our computer.
Python is bordered on its Python Official Page; however, to get us started, lets follow the step by step installation process below to get us all set.

  1. Getting Python From Official Page
  2. As already said, python is stored on its official page: we can however get it by visiting its official website.
    To achieve this, visit https://python.org/downloads or simply just go to Python Official Website.
    You should see screen like the one below:
  3. Installing Python
  4. Once you are on the installation page, now what you need to do is to select the installation based on your operating system. Once you find the installation suitable to your operating system. click on Download python, and the latest Python version will be downloaded.
    Other earlier versions are still available too.

Windows Operating System



On windows operating system, click on Install button as shown above, and enable "Add Python 3.7 to Path to add the python to the Path and then click Install now.
Now, Enable path limit or Disable it by selecting or deselecting Disable Path Length Limit thence you're done!
NB : This feature enables python to use long path names which may complicate the navigation though. .
After the installation is complete, open the CMD, and type the following:
>>> python -V
And boom, you should be able to see the version of Python you installed. Good luck windows fan!

Linux Operating System

Hey sir, wait! what if I am running linux on my machine?
Is that sounding familiar to you, then I'll be of help; Just scroll a little down.

In fact, by default, Linux comes with a pre-installed python ready for you. But incase you have to install it anyway, then you this is for you.

Installing Python on a Linux machine is just different than that of windows and is a matter of running few commands.
Below is a step-by-step guide on how you would install Python on your Linux machine.

Before you can install python on Linux, prepare your machine for installation by running the following commands:

User@hostname$ sudo apt-get install build-essential checkinstall
User@hostname$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Now that your machine has been prepared for download, what we now need to do is to install python itself.
You can do so by feeding the following commands to your Linux console:
User@hostname$ cd /usr/src
User@hostname$ sudo wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
The downloaded file is in a tar format for easy distribution of packages. However, we need to extract the file by running the command below:
User@hostname$ sudo tar xzf Python-3.7.2.tgz
Now, navigate into python folder, in this case, python-3.7.2 and run the commands below to compile the source code.
User@hostname$ sudo ./configure --enable-optimizations
User@hostname$ sudo make altinstall
This means you're done with python installation on Linux Machine

Installing Python On Mac Operating System

We have looked on how we would possibly install python on windows and Linux Operating systems respectively, and now lets mess around with Mac...
Hey sir, what did you say...? Yes, we are going to mess around with Mac; sorry I mean play around! hahahahah.

Just as with Linux that we had to prepare our Machine before installing Python, the same is true with Mac.
In Mac, the first thing we need to install is GCC, which can be obtained by downloading a Command Line Tool on Mac, the giant XCode.

You can download the XCode from official Apple Website.
If this is your first time installation of XCode, then run below command to add Commandline tools:
$ xcode-select --install
at this point, we have a bunch of command line utilities, with but one thing missing, the Package Manager. We can seal this horrendous hole by installing HomeBrew. Open your favourite terminal and write:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Now, add export PATH="/usr/local/opt/python/libexec/bin:$PATH" to add homebrew to /home/usr/.profile file.
Reaching this point, we can now successfully install our dear python as :
$ brew install python
And Now, you have a brand new nice-smelling python installed on your machine.

Verifying Installation

Reaching this point, I assume we all have python installed in our Machines. Let's check if we were successful with the installation.
We can do so by running the command below in our terminal or commandline:
$ python --version
This will show you python version you're running on your machine. I hope we're now on the good pos to get started