SlideShare a Scribd company logo
1 of 19
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

Similar to Intro to Programming Week 2_Python Installation.pptx

a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxcigogag569
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxManohar k
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 courseHimanshuPanwar38
 
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdf
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdfThe Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdf
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdfssuser8b3cdd
 
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfTraining report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfYadavHarshKr
 
Using Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentUsing Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentMahmoud Samir Fayed
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On PythonShivam Gupta
 
python intro and installation.pptx
python intro and installation.pptxpython intro and installation.pptx
python intro and installation.pptxadityakumawat625
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonRanjith kumar
 
session5-Getting stated with Python.pdf
session5-Getting stated with Python.pdfsession5-Getting stated with Python.pdf
session5-Getting stated with Python.pdfAyushDutta32
 
Computer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docxComputer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docxmccormicknadine86
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptxBharathYusha1
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PuneEthan's Tech
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxlemonchoos
 

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

a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
 
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdf
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdfThe Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdf
The Python Book_ The ultimate guide to coding with Python ( PDFDrive ).pdf
 
Lecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python LanguageLecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python Language
 
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfTraining report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
Using Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentUsing Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) Environment
 
Python PPT1.pdf
Python PPT1.pdfPython PPT1.pdf
Python PPT1.pdf
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On Python
 
python intro and installation.pptx
python intro and installation.pptxpython intro and installation.pptx
python intro and installation.pptx
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Getting Started with Python
Getting Started with PythonGetting Started with Python
Getting Started with Python
 
Core python programming tutorial
Core python programming tutorialCore python programming tutorial
Core python programming tutorial
 
session5-Getting stated with Python.pdf
session5-Getting stated with Python.pdfsession5-Getting stated with Python.pdf
session5-Getting stated with Python.pdf
 
Computer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docxComputer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docx
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech Pune
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 

Recently uploaded

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 

Recently uploaded (20)

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 

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