Installing Python and Python IDEs
Installing Python and Python IDEs
Python 1.0
Python 2.0
Python 3.0
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”.
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.)
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:
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.
• 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)
• 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.
20
20
Downloading IDEs
I Method
II Method
22
22
Spyder IDE
• Supported across Linux, Mac OS and Windows Platforms
• Features include:
Code Editor with Robust Syntax and Error Highlighting
Code Completion and Navigation
Debugger
Integrated Document
24
24
PyCharm
• Supported across Linux, Mac OS and Windows Platforms
• 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”
• Supports Julia, Python, R (that is why the name Jupyter) and also Scala
27
27
Jupyter Notebook
• Because the cells can also contain texts, they are very narrative and descriptive in
nature
• 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