0% found this document useful (0 votes)
70 views5 pages

Python

Python is an interpreted, high-level programming language that emphasizes code readability. It supports multiple programming paradigms and has a comprehensive standard library. Python was created in the 1990s and continues to be actively developed and maintained by a global community. It can be used for web development, software development, mathematics, and system scripting.

Uploaded by

gest
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
70 views5 pages

Python

Python is an interpreted, high-level programming language that emphasizes code readability. It supports multiple programming paradigms and has a comprehensive standard library. Python was created in the 1990s and continues to be actively developed and maintained by a global community. It can be used for web development, software development, mathematics, and system scripting.

Uploaded by

gest
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 5

Python:

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and


first released in 1991, Python' s design philosophy emphasizes code readability with its notable use
of significant whitespace. Its language constructs and object- oriented approach aim to help programmers write
clear, logical code for small and large-scale projects.

Python is dynamically typed and garbage-collected. It supports multiple programming paradigms,


including structured (particularly, procedural,) object-oriented, and functional programming. Python is often
described as a " batteries included" language due to its comprehensive standard library.

Python was conceived in the late 1980s as a successor to the ABC language. Python 2.0, released in 2000,
introduced features like list comprehensions and a garbage collection system capable of collecting reference cycles.
Python 3.0, released in 2008, was a major revision of the language that is not completely backward-compatible, and
much Python 2 code does not run unmodified on Python 3.

The Python 2 language, i.e. Python 2.7.x, was officially discontinued on 1 January 2020 (first planned for 2015)
after which security patches and other improvements will not be released for it. With Python 2' s end-of-life,
only Python 3.5.xand later are supported. Python interpreters are available for many operating systems. A global
community of programmers develops and maintains Python, an open source reference implementation. A non- profit
organization, the Python Software Foundation, manages and directs resources for Python and Python development.

Python is used for:

 web development (server-side),


 software development,
 mathematics,
 System scripting.

Python do?

 Python can be used on a server to create web applications.


 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and modify files.
 Python can be used to handle big data and perform complex mathematics.
 Python can be used for rapid prototyping, or for production-ready software development.

Why Python?

 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.).
 Python has a simple syntax similar to the English language.
 Python has syntax that allows developers to write programs with fewer lines than some other
programming languages.
 Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This
means that prototyping can be very quick.
 Python can be treated in a procedural way, an object-orientated way or a functional way.

Python compared to other programming languages

 Python was designed for readability, and has some similarities to the English language with influence
from mathematics.
 Python uses new lines to complete a command, as opposed to other programming languages which
often use semicolons or parentheses.
 Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions
and classes. Other programming languages often use curly-brackets for this purpose.

Python installation procedure:

Windows Based

It is highly unlikely that your Windows system shipped with Python already installed. Windows systems typically
do not. Fortunately, installing does not involve much more than downloading the Python installer from
the python.org website and running it. Let’s take a look at how to install Python 3 on Windows:

Step 1: Download the Python 3 Installer

1. Open a browser window and navigate to the Download page for Windows at python.org.

2. Underneath the heading at the top that says Python Releases for Windows, click on the link for the Latest Python
3 Release - Python 3.x.x. (As of this writing, the latest is Python 3.6.5.)

3. Scroll to the bottom and select either Windows x86-64 executable installer for 64-bit or Windows x86 executable
installer for 32-bit. (See below.)

Sidebar: 32-bit or 64-bit Python?

For Windows, you can choose either the 32-bit or 64-bit installer. Here’s what the difference between the two comes
down to:

 If your system has a 32-bit processor, then you should choose the 32-bit installer.
 On a 64-bit system, either installer will actually work for most purposes. The 32-bit version will
generally use less memory, but the 64-bit version performs better for applications with intensive
computation.
 If you’re unsure which version to pick, go with the 64-bit version.

Note: Remember that if you get this choice “wrong” and would like to switch to another version of Python, you can
just uninstall Python and then re-install it by downloading another installer from python.org.

Step 2: Run the Installer

Once you have chosen and downloaded an installer, simply run it by double-clicking on the downloaded file. A
dialog should appear that looks something like this:

Important: You want to be sure to check the box that says Add Python 3.x to PATH as shown to ensure that the
interpreter will be placed in your execution path.

Then just click Install Now. That should be all there is to it. A few minutes later you should have a working Python
3 installation on your system.

Mac OS based

While current versions of macOS (previously known as “Mac OS X”) include a version of Python 2, it is likely out
of date by a few months. Also, this tutorial series uses Python 3, so let’s get you upgraded to that.

The best way we found to install Python 3 on macOS is through the Homebrew package manager. This approach is
also recommended by community guides like The Hitchhiker’s Guide to Python.
Step 1: Install Homebrew (Part 1)

To get started, you first want to install Homebrew:

1. Open a browser and navigate to http://brew.sh/. After the page has finished loading, select the Homebrew
bootstrap code under “Install Homebrew”. Then hit cmd+c to copy it to the clipboard. Make sure you’ve captured
the text of the complete command because otherwise the installation will fail.

2. Now you need to open a Terminal app window, paste the Homebrew bootstrap code, and then hit Enter. This will
begin the Homebrew installation.

3. If you’re doing this on a fresh install of macOS, you may get a pop up alert asking you to install Apple’s
“command line developer tools”. You’ll need those to continue with the installation, so please confirm the dialog
box by clicking on “Install”.

At this point, you’re likely waiting for the command line developer tools to finish installing, and that’s going to take
a few minutes. Time to grab a coffee or tea!

Step 2: Install Homebrew (Part 2)

You can continue installing Homebrew and then Python after the command line developer tools installation is
complete:

1. Confirm the “The software was installed” dialog from the developer tools installer.

2. Back in the terminal, hit Enter to continue with the Homebrew installation.

3. Homebrew asks you to enter your password so it can finalize the installation. Enter your user account password
and hit Enter to continue.

4. Depending on your internet connection, Homebrew will take a few minutes to download its required files. Once
the installation is complete, you’ll end up back at the command prompt in your terminal window.

Whew! Now that the Homebrew package manager is set up, let’s continue on with installing

Python 3 on your system.

Step 3: Install Python

Once Homebrew has finished installing, return to your terminal and run the following command:

$ brew install python3

Note: When you copy this command, be sure you don’t include the $ character at the beginning.

That’s just an indicator that this is a console command.

This will download and install the latest version of Python. After the Homebrew brew install command finishes,
Python 3 should be installed on your system.

You can make sure everything went correctly by testing if Python can be accessed from the terminal:

1. Open the terminal by launching Terminal app.

2. Type pip3 and hit Enter.

3. You should see the help text from Python’s “Pip” package manager. If you get an error message running pip3, go
through the Python install steps again to make sure you have a working Python installation.
Assuming everything went well and you saw the output from Pip in your command prompt window…
congratulations! You just installed Python on your system, and you’re all set to continue with the next section in this
tutorial.

Packages need for python based programming:

 Numpy

NumPy is a Python package which stands for ' Numerical Python' It is the core library for scientific
computing, which contains a powerful n-dimensional array object, provide tools for integrating C, C++ etc. It is also
useful in linear algebra, random number capability etc.

 Pandas

Pandas is a high-level data manipulation tool developed by Wes McKinney. It is built on the Numpy package and its
key data structure is called the Data Frame. Data Frames allow you to store and manipulate tabular data in rows of
observations and columns of variables.

 Keras

Keras is a high-level neural networks API, written in Python and capable of running on top of Tensor Flow, CNTK,
or Theano. Use Keras if you need a deep learning library that:

Allows for easy and fast prototyping (through user friendliness, modularity, and extensibility).

 Sklearn

Scikit-learn is a free machine learning library for Python. It features various algorithms like support vector machine,
random forests, and k-neighbors, and it also supports Python numerical and scientific libraries
like NumPy and SciPy.

 Scipy

SciPy is an open-source Python library which is used to solve scientific and mathematical problems. It is built on
the NumPy extension and allows the user to manipulate and visualize data with a wide range of high-level
commands.

 Tensorflow

Tensor Flow is a Python library for fast numerical computing created and released by Google. It is a foundation
library that can be used to create Deep Learning models directly or by using wrapper libraries that simplify the
process built on top of Tensor Flow.

 Django

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on
writing your app without needing to reinvent the wheel. It' s free and open source.

 Pyodbc

pyodbc is an open source Python module that makes accessing ODBC databases simple. It implements the DB API
2.0 specification but is packed with even more Python convenience. Precompiled binary wheels are provided for
most Python versions on Windows and macOS. On other operating systems this will build from source.
 Matplotlib

Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data


visualization library built on NumPy arrays and designed to work with the broader SciPy stack. It was introduced by
John Hunter in the year 2002.

 Opencv

OpenCV-Python is a library of Python bindings designed to solve computer vision problems. Python is a general


purpose programming language started by Guido van Rossum that became very popular very quickly, mainly
because of its simplicity and code readability.

 Nltk

Natural Language Processing with Python NLTK is one of the leading platforms for working with human language
data and Python, the module NLTK is used for natural language processing. NLTK is literally an acronym for
Natural Language Toolkit. In this article you will learn how to tokenize data (by words and sentences).

 SQLAIchemy

SQLAlchemy is a library that facilitates the communication between Python programs and databases. Most of the
times, this library is used as an Object Relational Mapper (ORM) tool that translates Python classes to tables on
relational databases and automatically converts function calls to SQL statements.

 Urllib

Urllib is a Python module that can be used for opening URLs. It defines functions and classes to help in URL
actions. With Python you can also access and retrieve data from the internet like XML, HTML, JSON, etc. You can
also use Python to work with this data directly.

Installation of packages:

Syntax for installation of packages via cmd terminal using the basic

Step:1- First check pip cmd

First check pip cmd

If ok then

Step:2- pip list

Check the list of packages installed and then install required by following cmds

Step:3- pip install package name

The package name should as requirement

You might also like