top of page

Python Programming Language

Updated: Jul 7, 2021


Introduction:


What is Python Programming Language?


Python is basically high level, object oriented, interpreted programming language with dynamic semantics. Python is easy to learn, it has easy syntax even a person having no knowledge of coding or programming can learn it, if he/she is good in English.


What are the uses of Python?


Python is high level built in dynamic language which make it good for Machine learning, App development, Artificial Intelligent, Data Science, Data Analysis, Data Structure and much more.


It has vast number of libraries, as it is simple and easy to write, many programmers prefers Python instead of other languages. It is less expensive to write code in Python instead of other languages.


Installation:


There many ways to install python in Linux Ubuntu 18 or 20, some of them are


Option 1:


Installing Python 3 using APT package manager.


Mostly, Ubuntu 18.x or 20.x come with Python pre-installed, to check whether it is installed or the version is up to date.


python ––version

If python3 is not installed or not up to date, then by using Apt package manager you can install it, it is the easiest way to install python as there are fewer steps but it uses third party hosting software, which can cause problems in updates.


Step 1:


Updating and refreshing repository:-


Open a terminal window, and enter the following:


~sudo apt update

Step 2:


Install Supporting Software:-


The software-properties-common package is used to give better control on package manager by adding PPA(Personal Package Archive) repositories. Command for installing supporting software is :


~sudo apt install software-properties-common

Step 3:


Installing Deadsnakes PPA:-


Deadsnakes is a PPA with newer releases than the default Ubuntu repositories. Add the PPA by entering the following command:


~sudo add-apt-repository ppa:deadsnakes/ppa

After this command, you will have to press enter in order to continue and let that finish. When its is finish refresh the repository again by:


~sudo apt update

Step 4:


Installing Python3:-


This is last step, now you can start installing python 3.8 with this command:


~sudo apt install python3.8

After installation you can version of Python by:


python ––version

Option 2:


Installing Python 3.8.3 from source code.


Use this process to download and compile the source code from the developer. It’s a bit more complicated, but the agreement is accessing a newer release of Python.


Step 1:


Updating Local repository:-


To update local repository use the following command:


~sudo apt update

Step 2:


Installing supporting software:-


Sometime compiling a package from source code you need to install additional software.


For this code enter the following command to install supporting software:


~sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget

Step 3:


Downloading the latest version of source code:-


To download the newest release of Python Source Code, navigate to the <strong>/tmp</strong> directory and use the <strong>wget</strong> command:


~cd /tmp

~wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz

Step 4:


Next, you need to extract the downloaded file, with the following command:


tar –xf Python-3.8.3.tgz

Step 5:


Testing system and optimizing Python:-


Before installing the software, make sure that you tested the system and optimized python.


The <strong>./configure</strong> command evaluates and prepares Python to install on your system. Using the <strong>––optimization</strong> option speeds code execution by 10-20%.


Enter the following commands:


~cd python-3.8.3

./configure ––enable–optimizations

This may take up to 30 minutes.


Step 6:


Installing a second instance of Python(Recommended):-


To create a second installation of Python 3.8.35, in addition to your current Python installation, enter the following command:


sudo make install

Allow the process to complete.




Above the different options and each option have some steps which you have to follow to install python.

Recent Posts

See All

Comments


Post: Blog2_Post
bottom of page