📅 03/05/2020
✍️ Sreelal TS

How to install Python?


Welcome to Python programming tutorial by Learn A Bit. We are spreading learning resources on our Instagram page, as daily capsules. In this article, we are looking at what Python is and how to install python in your machine. :)

A little about Python 🐍 Python is an interpreted, high-level, general-purpose programming language created by Guido van Rossum. It was first released in 1991 and now is one of the most popular programming languages. Nowadays, Python is used in a vast variety of aspects of tech. Varying from server-side web development, software development, to machine learning to system scripting and more. As a cross-platform language Python works on different platforms including Windows, Mac, Linux Raspberry Pi, and more. And, Python has one of the simplest, straight forward syntaxes. For example,

print(“Hello, world!”)
and we’re done printing “Hello, world!”. Pretty straight forward. 😌 You don’t need to align the current program to some packages neither you want to import some kind of usual cliches other C-like languages requires to just print a string. Python’s design philosophies mainly encourage code readability with its notable use of whitespaces. Python is an interpreted language, meaning it’s executed as line by line. And, literally makes prototyping real quick. Python’s object-oriented concepts enhance the way programmers to write clear, logical code for small and large-scale projects.

Do I "REALLY" need to install Python? 👀 Python version 2.7, released in 2010, is perhaps the most widely used of all Python versions. But, however, the most recent major released version is Python 3.0 - often stylized as Python “3.x” to represent all incremental updates to 3.0.

At first, you may not want to rush to install Python now. Some OSs have Python 2.7 installed by default. You can make sure if Python was already installed in your machine by running $ python --version In the command line/terminal. If you receive and output like Python 2.7.xx. That’s it, your machine has Python 2.x support by default.

Otherwise, you now want to install Python by yourself.

Install Python 👨‍💻👩‍💻 On Windows:

  1. Navigate to Python.org > Downloads.
  2. Click on the link/button to download Python 2.x/3.x
  3. Open the downloaded .msi/.exe file, and follow the instructions provided.

Now open command prompt again, and run the
$python --version again to confirm Python is successfully installed on your machine.

On Linux/Unix Ubuntu 17.10 and later releases come with Python installed by default. For previous versions: run the following commands in terminal:
$ sudo apt-get update $ sudo apt-get install python
Or
$ sudo apt-get install python3.6
Confirm your installation with $ python --version Releases for Mac Python releases for Mac OS X can be found at this link . You can get the installation instructions there as well.

Hello, world! 🙋🏻‍♂️ Now, create a hello.py on your work directory. Add this line to your hello.py and save it.

print(“Hello, world!”)
Now, open the terminal and navigate to your work directory. And run: $ python “hello.py” That’s it you will now get “Hello, world” as output. That’s it you now have successfully completed your very first program of Python. 🥳

That's It! Thanks for reading :)
We hope you caught up with us! Stay in the loop, we will keep posting tech learning resources in our instagram page! Don't forget to follow: @learn_a_bit for further updates! See ya! Once again, thanks!