SlideShare a Scribd company logo
INTRODUCTION TO PROGRAMMING
IKSAN BUKHORI, M.PHIL.
PYTHON INSTALLATION
TWO WAYS TO INSTALL
 You can either choose to install Python directly, or through a package manager. One of the most popular
one is called Anaconda
 Installing Python directly is easier, and only installs additional very lightweight IDE called IDLE. You can
write python program by either
1. Write and run it through IDLE
2. Write and run the code directly from command prompt
3. Installing other IDEs and write/run the program from there
4. Write the python code in a notepad or notepad++ and run it through command prompt
 On the other hand, direct python installation only installs a package manager called pip, and you will
only have access to packages in Python language
TWO WAYS TO INSTALL
 Installing Anaconda also installs python (if python has not been installed yet).
 Installing Python directly is a little bit more complicated, and it installs a comparatively more heavy
Anaconda navigator. You can write and run python program by
1. Write and run it through IDEs which can be installed from Anaconda Navigator
2. Write and run the code directly from anaconda prompt
3. Write the python code in a notepad or notepad++ and run it through anaconda prompt
 On the other hand, python installation through Anaconda installs a package manager called Conda, and
you with this you can have access to packages written not only in Python but other languages too.
DIRECT PYTHON INSTALLATION
PYTHON INSTALLATION
 Go to https://www.python.org/downloads/windows/
 Download the latest release of Python
 Run the installer, and make sure to add python to PATH
WORKING WITH COMMAND PROMPT
CODING IN INTERACTIVE MODE
 Once python is installed, you can open command prompt and type “python” (without quotation mark) to
write and run python code
 If Python is already properly installed and added to the PATH, you will see something like this
 Now, try to type print(‘hello world!’) and press ENTER.
 Congratulations! You wrote your first program in Python!
RUNNING SCRIPT FROM COMMAND PROMPT
 Writing codes directly through command prompt
can be quite limited
 Thus, let’s try to write a script in a file. One the
(best) way to do this is by using Notepad++ which
can be downloaded from https://notepad-plus-
plus.org/downloads/
 In this Notepad++, change language into Python
 Now, write your hello world program (i.e.,
print(‘hello world’))
 Save the file into your preferred directory.
RUNNING SCRIPT FROM COMMAND PROMPT
 Now that you have your script saved, we can run it through command prompt
 First, open your command prompt
 If the file is in different drive compared to the default one (for example, my default cmd directory is C: but
I saved my python script in drive D: ), type the drive letter followed by colon “:” to change the drive
 Now, change the directory to the folder where you saved the script by using cd command, for example;
RUNNING SCRIPT FROM COMMAND PROMPT
 Now run the command python followed by the name of your scripts. Don’t forget the .py extension!
 Congratulations! Now you can write any python program using notepad++ and run it using command
prompt!
WRITING AND EDITING SCRIPT USING IDLE IDE
 Instead of using notepad++ to write script and using cmd to run it, you can use IDLE IDE which is
installed alongside python installation. Just find program called IDLE in your system and run it
 You can write your script in IDLE window and save it to any directory you preferred
 You can run the script by selecting RunRun Module on the menu bar
ANACONDA
ANACONDA INSTALLATION
 Go to https://www.anaconda.com/products/individual
 Download windows Installer for the version you like (Or any release suitable to the Python version you installed,
if you already installed python separately)
 Proceed with the installation with recommended settings (Note: When the dialog gave you two checkboxes, the
top one being the option to add Anaconda to PATH, follow the recommendation and check THE BOTTOM
CHECKBOX ONLY)
 Once installed, there are two important applications that will be in your system.
 First is called Anaconda prompt, which acts like cmd and helps you to install packages using either Conda or pip
package manager (Note that you can also install packages through Navigator, but you can only use Conda this
way)
 The second is called Anaconda Navigator. When you open this Navigator, you will be shown a lot of IDEs that can
be used. Some of these IDEs may be ready to launch, some others may need to be installed
ANACONDA NAVIGATOR
Tons of
IDEs You
can Use
for Many
languages
Control for Programming
Environments
PYTHON ENVIRONMENT
 When writing a program in python, we can create isolated environment in which we can create python project
(i.e. python program consisting of scripts and other supporting components)
 This allows a structured way creating multiple projects, where the programmer may install specific sets of
packages that are really necessary for each project
 Programmer may even use different python version in different environment
 In cmd, a command “py -m venv env” (without quotation marks) can be executed from a directory to create
virtual environment called venv
 We can enter this virtual environment by changing directory to this environment (using cd venv) and execute
“Scriptsactivate” (without quotation marks)
 Now you can install packages you want for your project stored in that the folder where venv is located
 In Anaconda Navigator, you can create new virtual environment easily using “Environments” button on the left
panel, and select the IDE you want run in this environment via the drop down menu above the list of IDEs
 That being said, for now we will simply use the default environment (“base” or “root”)
IMPORTANT NOTES BEFORE WE START
 Remember, just like a lot of other programming languages, Python is case sensitive!
 Unlike many other programming language, indentation is very crucial in Python scripts.
 When using a “paired symbols” in a line of code such as a pair of double quotes, a pair of single quotes,
parenthesis, etc. make sure that they really are a pair. For example when using parenthesis, make sure
that every opening parenthesis has exactly one closing parenthesis
 A comment is a line of code that will not be evaluated by compiler/interpreter. It is useful to provide extra
information which may help to make the script more readable. In python, a comment is a line that starts
with #
 It is not mandatory, but in python there are several unwritten rules about writing a script. One of them is
to write a variable with two words all in lower case separated by underscore. There are other ‘writing
style rules’, commonly referred as PEP 8 of which the complete list you can find here:
https://peps.python.org/pep-0008/
 Along the journey, we will see a lot of writing styles either being mandatory or highly suggested by
Python community
HOMEWORK 1
2. Try Multiple IDEs for Python and choose one that suits you the best
THANK YOU

More Related Content

PDF
Pyhton-1a-Basics.pdf
PDF
python-handbook.pdf
PDF
Fundamentals of python
PDF
Unit 1-Part-1-Introduction to Python.pdf
PPTX
Chapter 2: Basics of programming pyton programming
PDF
Introduction to Python Unit -1 Part .pdf
PDF
The Python for beginners. This is an advance computer language.
PPTX
UNIT 1 PYTHON introduction and basic level
Pyhton-1a-Basics.pdf
python-handbook.pdf
Fundamentals of python
Unit 1-Part-1-Introduction to Python.pdf
Chapter 2: Basics of programming pyton programming
Introduction to Python Unit -1 Part .pdf
The Python for beginners. This is an advance computer language.
UNIT 1 PYTHON introduction and basic level

Similar to Intro to Programming Week 2_Python Installation.pptx (20)

PPTX
Session-1_Introduction to Python.pptx
PPTX
python intro and installation.pptx
PPTX
Introduction to Python Programming language.pptx
PPTX
Python_Introduction_Good_PPT.pptx
PPTX
introduction to python in detail including .pptx
PPTX
Python Course Basic
PDF
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdf
PPT
python-ppt.ppt
PPT
python-ppt.ppt
PDF
Python programming
PDF
CSC2308 - PRINCIPLE OF PROGRAMMING II.pdf
PPT
Introduction to python
PDF
05 python.pdf
PDF
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
PPTX
PYTHON FEATURES.pptx
PDF
Python Programming Hans-petter Halvorsen.pdf
PDF
Python PPT1.pdf
PPTX
Introduction to python.pptx
PDF
Python_Session
PDF
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Session-1_Introduction to Python.pptx
python intro and installation.pptx
Introduction to Python Programming language.pptx
Python_Introduction_Good_PPT.pptx
introduction to python in detail including .pptx
Python Course Basic
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdf
python-ppt.ppt
python-ppt.ppt
Python programming
CSC2308 - PRINCIPLE OF PROGRAMMING II.pdf
Introduction to python
05 python.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
PYTHON FEATURES.pptx
Python Programming Hans-petter Halvorsen.pdf
Python PPT1.pdf
Introduction to python.pptx
Python_Session
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Ad

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
medical staffing services at VALiNTRY
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Introduction to Artificial Intelligence
PDF
System and Network Administraation Chapter 3
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Odoo Companies in India – Driving Business Transformation.pdf
Odoo POS Development Services by CandidRoot Solutions
Upgrade and Innovation Strategies for SAP ERP Customers
How to Choose the Right IT Partner for Your Business in Malaysia
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Design an Analysis of Algorithms II-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
2025 Textile ERP Trends: SAP, Odoo & Oracle
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
medical staffing services at VALiNTRY
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction to Artificial Intelligence
System and Network Administraation Chapter 3
Ad

Intro to Programming Week 2_Python Installation.pptx

  • 3. TWO WAYS TO INSTALL  You can either choose to install Python directly, or through a package manager. One of the most popular one is called Anaconda  Installing Python directly is easier, and only installs additional very lightweight IDE called IDLE. You can write python program by either 1. Write and run it through IDLE 2. Write and run the code directly from command prompt 3. Installing other IDEs and write/run the program from there 4. Write the python code in a notepad or notepad++ and run it through command prompt  On the other hand, direct python installation only installs a package manager called pip, and you will only have access to packages in Python language
  • 4. TWO WAYS TO INSTALL  Installing Anaconda also installs python (if python has not been installed yet).  Installing Python directly is a little bit more complicated, and it installs a comparatively more heavy Anaconda navigator. You can write and run python program by 1. Write and run it through IDEs which can be installed from Anaconda Navigator 2. Write and run the code directly from anaconda prompt 3. Write the python code in a notepad or notepad++ and run it through anaconda prompt  On the other hand, python installation through Anaconda installs a package manager called Conda, and you with this you can have access to packages written not only in Python but other languages too.
  • 6. PYTHON INSTALLATION  Go to https://www.python.org/downloads/windows/  Download the latest release of Python  Run the installer, and make sure to add python to PATH
  • 8. CODING IN INTERACTIVE MODE  Once python is installed, you can open command prompt and type “python” (without quotation mark) to write and run python code  If Python is already properly installed and added to the PATH, you will see something like this  Now, try to type print(‘hello world!’) and press ENTER.  Congratulations! You wrote your first program in Python!
  • 9. RUNNING SCRIPT FROM COMMAND PROMPT  Writing codes directly through command prompt can be quite limited  Thus, let’s try to write a script in a file. One the (best) way to do this is by using Notepad++ which can be downloaded from https://notepad-plus- plus.org/downloads/  In this Notepad++, change language into Python  Now, write your hello world program (i.e., print(‘hello world’))  Save the file into your preferred directory.
  • 10. RUNNING SCRIPT FROM COMMAND PROMPT  Now that you have your script saved, we can run it through command prompt  First, open your command prompt  If the file is in different drive compared to the default one (for example, my default cmd directory is C: but I saved my python script in drive D: ), type the drive letter followed by colon “:” to change the drive  Now, change the directory to the folder where you saved the script by using cd command, for example;
  • 11. RUNNING SCRIPT FROM COMMAND PROMPT  Now run the command python followed by the name of your scripts. Don’t forget the .py extension!  Congratulations! Now you can write any python program using notepad++ and run it using command prompt!
  • 12. WRITING AND EDITING SCRIPT USING IDLE IDE  Instead of using notepad++ to write script and using cmd to run it, you can use IDLE IDE which is installed alongside python installation. Just find program called IDLE in your system and run it  You can write your script in IDLE window and save it to any directory you preferred  You can run the script by selecting RunRun Module on the menu bar
  • 14. ANACONDA INSTALLATION  Go to https://www.anaconda.com/products/individual  Download windows Installer for the version you like (Or any release suitable to the Python version you installed, if you already installed python separately)  Proceed with the installation with recommended settings (Note: When the dialog gave you two checkboxes, the top one being the option to add Anaconda to PATH, follow the recommendation and check THE BOTTOM CHECKBOX ONLY)  Once installed, there are two important applications that will be in your system.  First is called Anaconda prompt, which acts like cmd and helps you to install packages using either Conda or pip package manager (Note that you can also install packages through Navigator, but you can only use Conda this way)  The second is called Anaconda Navigator. When you open this Navigator, you will be shown a lot of IDEs that can be used. Some of these IDEs may be ready to launch, some others may need to be installed
  • 15. ANACONDA NAVIGATOR Tons of IDEs You can Use for Many languages Control for Programming Environments
  • 16. PYTHON ENVIRONMENT  When writing a program in python, we can create isolated environment in which we can create python project (i.e. python program consisting of scripts and other supporting components)  This allows a structured way creating multiple projects, where the programmer may install specific sets of packages that are really necessary for each project  Programmer may even use different python version in different environment  In cmd, a command “py -m venv env” (without quotation marks) can be executed from a directory to create virtual environment called venv  We can enter this virtual environment by changing directory to this environment (using cd venv) and execute “Scriptsactivate” (without quotation marks)  Now you can install packages you want for your project stored in that the folder where venv is located  In Anaconda Navigator, you can create new virtual environment easily using “Environments” button on the left panel, and select the IDE you want run in this environment via the drop down menu above the list of IDEs  That being said, for now we will simply use the default environment (“base” or “root”)
  • 17. IMPORTANT NOTES BEFORE WE START  Remember, just like a lot of other programming languages, Python is case sensitive!  Unlike many other programming language, indentation is very crucial in Python scripts.  When using a “paired symbols” in a line of code such as a pair of double quotes, a pair of single quotes, parenthesis, etc. make sure that they really are a pair. For example when using parenthesis, make sure that every opening parenthesis has exactly one closing parenthesis  A comment is a line of code that will not be evaluated by compiler/interpreter. It is useful to provide extra information which may help to make the script more readable. In python, a comment is a line that starts with #  It is not mandatory, but in python there are several unwritten rules about writing a script. One of them is to write a variable with two words all in lower case separated by underscore. There are other ‘writing style rules’, commonly referred as PEP 8 of which the complete list you can find here: https://peps.python.org/pep-0008/  Along the journey, we will see a lot of writing styles either being mandatory or highly suggested by Python community
  • 18. HOMEWORK 1 2. Try Multiple IDEs for Python and choose one that suits you the best