Installing Python and Python IDEs

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 30

Python Versions

• First Released in 1991.

• Since then, there have been three version changes in Python:

 Python 1.0
 Python 2.0
 Python 3.0

• The latest available version is Python 3.9

• Python offers support across various platforms (Linux, Windows, Mac)

1
1
Python Distributions (Various Ways to Implement
Python)
1. CPython: This is the original and most-maintained implementation of Python,
written in C. New language features generally appear here first. It is managed by
the “Python Software Foundation”.

• CPython is the most conservative in terms of its optimisations.


• It is the best choice when someone wants to maintain compatibility with Python
standards and is willing to work with Python in its most fundamental incarnation.
• But, then its limitation is that there are no advanced libraries and no third-party
additions for the sake of performance.
• Those are all things you can add on your own, but they’re not bundled.
• Again, all this is by design, to ensure maximum compatibility and to allow
CPython to serve as a reference implementation, but it means any performance
optimizations are up to the developer.
• The ecosystem downloaded from Python.org is Cpython (Default)
2
2
Python Distributions
2. Jpython: Python implemented in Java.

3. Python for .NET

4. PyPy: An implementation of Python written completely in Python. It supports


several advanced features not found in other distributions. One of the goals of the
project is to encourage experimentation with the language itself by making it easier
to modify the interpreter (since it is written in Python).

3
3
Python Distributions
5. Anaconda Distribution: Anaconda, produced by Anaconda, Inc. (formerly
Continuum Analytics), is designed for Python developers who need a distribution
backed by a commercial provider and with support plans for enterprises. The chief
use cases for Anaconda Python are Maths, Statistics, Engineering, Data Analysis,
Machine Learning, and related applications.

• Anaconda bundles many of the most common libraries used in commercial and
scientific Python work—SciPy, NumPy, Numba, and so on—and makes many
more of them accessible via a custom package mamagement system.

• Anaconda stands out from other distributions in how it integrates all these pieces.
When installed, Anaconda provides a desktop app—the Anaconda Navigator—
that makes every aspect of the Anaconda environment available through a
convenient GUI. Finding components, keeping them up to date, and working
with them is a good deal easier out of the box with Anaconda than with CPython.
4
4
Coding Environment
• In general, any software programme can be written using a terminal, a
command prompt (cmd), a text editor or through an Integrated Development
Environment (IDE).

• The program needs to be saved in a file with an appropriate extension (.py for
Python, .mat for matlab, etc.) and can be executed in the corresponding
environment (Python, Matlab, etc.)

• Integrated Development Environment (IDE) is a software product solely


developed to support software development in various or specific programming
language(s). For example, the various IDEs available for Python are PyCharm,
Spidyr, Jupityr etc.

5
5
1. Online Terminal or Online Python Console for
Python
• Python provides an Online Terminal which can be accessed from the website
python.org

• The online terminal can be used to executed a limited set of options in Python
such as:

 Basic Print Statement


 Assigning values to Variables
 Basic Mathematical Operations
 Conditional Operations, looping statements
 Function Declaration and Calling
 Installing Modules

6
6
Online Terminal or Online Python Console for
Python Clicking on this launches the Online
Python Terminal which can be used for
basic Operations

7
7
Online Terminal or Online Python Console for
Python

8
8
2. Using Python Command Prompt
Download the latest version of Python from Python.Org

9
9
Ensure that this
checkbox is
checked

10
10
Using Python Command Prompt
To open the Command Prompt, type Python in the search bar

11
11
Using Windows Command Prompt to use Python
The same window can also be opened using the Command Prompt
Search Command Prompt in the Search Bar or Press Windows+R button and
then type cmd. (Note that this can only be done if you clicked the Add Python
3.9 to PATH while installing Python). Write python in the command prompt.

12
12
3. Using Text Editor
We can also type the programme in a text editor such as Notepad and then
execute it using command prompt. The advantage of using a text editor is that
it can be used to easily format, cut, copy, paste etc. and more importantly save
your programme statements. Because once a command prompt window is
closed, the programme cannot be retrieved.

13
13
Using Text Editor
Save the File using the .py extension

14
14
Using Text Editor
Open the File Using Command Prompt using the Syntax:
python “File Location”

15
15
Using Text Editor
The other option is to first change the Command Prompt Directory to the
Folder where the file is stored and then type the file name.

16
16
Adding a –i (hyphen i) before the file location
not only executes the programme code but
activates the Python Interpreter as well as
can be seen from the >>> sign. The contents
of the file can therefore be further operated
upon.

17
17
4. Using an Integrated Development Environment
(IDE)
• The use of a text editor is a two-stage procedure. First the code has to be
written in a text editor and then executed using the command prompt. An
IDE makes it possible to write and execute the commands in a single
platform. The objective of using an IDE is to simplify software development.

• IDEs integrate several tools specifically designed for software development.


These tools usually include:

 An editor designed to handle code (with, for example, syntax highlighting


and auto-completion)
 Build, execution, and debugging tools
 Some form of source control

• Most IDEs support many different programming languages and offer better
graphical user interfaces (GUIs) as compared to the standard language 18

terminals. 18
4. Using an Integrated Development Environment
(IDE)

• A typical IDE comprises the following features:


 Source Code Editor
 Compiler
 Debugger
 Additional features include syntax and error highlighting, code completion

• An IDE also offers support in building and executing the programme along
with debugging the code from within the environment

19
19
4. Using an Integrated Development Environment
(IDE)
• Some of the General IDEs with Python Support are Visual Studio, Visual
Studio Code, Sublime Text, and Atom

• Some of the most commonly used Python-specific IDEs are the default IDE
that comes with the Cpython Distribution named IDLE; Spyder, Jupyter,
and PyCharm.

• In order to use these IDEs, first Python needs to be installed and then these
can need to be downloaded from their respective websites.

• Alternatively, one can download a distribution such as Anaconda that


includes the Python Software along with IDEs such as Spyder and Jupyter
Notebooks.

20
20
Downloading IDEs
I Method

Download Anaconda Distribution from the website:


https://www.anaconda.com/products/individual
It contains IDEs such as Spyder, Jupyter Notebook and PyCharm.
In this case, there is no need to download Python separately from the website.

II Method

First ensure that Python is installed in your system. Then go to command


Prompt (cmd or Windows+R) and type:
pip install spyder
pip install jupyter

Pycharm can be downloaded from the website


https://www.jetbrains.com/pycharm/
21
21
Python IDLE
• Python IDLE comes bundled with the Default Distribution (CPython)
• It is also called as Python

To launch it, search for IDLE in the Search Bar of Windows.

22
22
Spyder IDE
• Supported across Linux, Mac OS and Windows Platforms

• Available as Open Source Version

• Can be installed separately (after installing Python in your system) or through


Anaconda Distribution

• Developed for Python and specifically data science

• Features include:
 Code Editor with Robust Syntax and Error Highlighting
 Code Completion and Navigation
 Debugger
 Integrated Document

• Interface similar to MATLAB and RStudio


23
23
Spyder IDE

24
24
PyCharm
• Supported across Linux, Mac OS and Windows Platforms

• Available as Community (free open source) and professional (paid) version

• Can be installed separately (after installing Python in your system from the
PyCharm Website) or through Anaconda Distribution (Only PyCharm
Professional Version is available on Anaconda)

• Features include:
 Code Editor Provides Syntax and Error Highlighting
 Code Completion and Navigation
 Unit Testing
 Debugger
 Version Control

• More suited for those who have a background in software development; but
again is a great tool for data science 25
25
PyCharm

26
26
Jupyter Notebook
• It is a web application (unlike Spyder and PyCharm) that allows creation and
manipulation of documents called “notebooks”

• Supported across Linux, Mac OS and Windows Platforms

• Available as an open source version

• Bundled with Anaconda Distribution or can be installed separately

• Supports Julia, Python, R (that is why the name Jupyter) and also Scala

• A Jupyter Notebook consists of an ordered collection of input and output cells


that contain code, text, plots etc.

27
27
Jupyter Notebook
• Because the cells can also contain texts, they are very narrative and descriptive in
nature

• Jupyter is therefore mostly used as an education and presenter tool

• Allows Sharing of Code and Narrative Text through Output Formats like PDF,
HTML etc.

• It, however, lacks most of the features of a good IDE but then it makes up for it
by allowing to add text and plots in cells

28
28
Jupyter Notebook Interface

29
29
How to choose the best IDE?
• There are many IDEs available. So how do we choose what works for us?

• The choice of an IDE depends entirely on the user’s requirements. To identify the
requirements, the user needs to first work with different IDEs

• For someone, a narrative text along with the code would be better (Hence,
Jupyter is the preferred IDE in this case)

• For another, a good Graphical User Interface (GUI) may be of a greater concern
(Hence, Spyder is to be preferred)

• There is nothing like a good IDE or a bad IDE. Every IDE has features which are
very different from the other IDEs. It is important therefore to work with all the
IDEs, identify your requirements and then choose the one which is most suited to
your needs.
30
30

You might also like