SlideShare a Scribd company logo
1 of 16
Python and Django
A first taste
What is Python?
• General purpose, interpreted
• Supports procedural, object oriented, functional
paradigms
• Easy for newcomers
Python
Used in many application domains:
web development, gaming, animation, scientific
computing, robotics, spacecraft control, desktop
applications, testing microchips …
Google, Youtube, Disqus, Reddit, Dropbox, Disney,
Pixar, Nasa, Rasberry Pi, Intel …
Python philosophy
• Readable code
“Code is read much more often than it is written”
• Developer productivity, built-in toolset
Large standard library / third party libraries
Whitespace is important
if 1 < 2:

print 'Numbers behaving normally'





def my_function(a, b):

return a + b

my_function(2, 3)
Get up and running with
Python quickly
• Free online book: “Dive Into Python”
• Try out the interpreter
$ python
Python 2.7.6 (default, Sep 9 2014,
15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0
(clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or
"license" for more information.
>>>
>>> 5 + 4
9
>>> name = 'Ellen'
>>> print name
Ellen
>>>
Modules and Packages
import module
import package.module
PyPi - Python Package index. Over 56,000 packages
pip - python package manger
pip install package-name
pip install -r requirements.txt
pip freeze > requirements.txt
Virtual Machine
Develop in the same environment, on the same OS as
your web server
Virtual Environment
Keep the dependencies required by different projects
in separate places.
Debugging with pdb / ipdb
Interactive source code debugger
Supports
• stepping though code
• setting conditional breakpoints
• printing values
• evaluating python code
import ipdb
ipdb.set_trace()
Django
web development framework
Web development with
Django framework
MVC Django deals with
Models Models data
Controllers Views what you see
Views Templates how you see it
Django
• Reusable modules = ‘apps’
• ORM (Object-Relational Mapping)
• Templating
• Routing
• Forms library
Django Automatic Admin
• What python is and what it’s used for
• How to start with python
• Libraries - modules and packages
• Development environment
• Web development framework Django

More Related Content

Similar to A first taste of Python and Django

Welcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdfWelcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdfdigitaldnyan
 
Welcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdfWelcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdfdigitaldnyan
 
Welcome to Python Programming Language.pptx
Welcome to Python Programming Language.pptxWelcome to Python Programming Language.pptx
Welcome to Python Programming Language.pptxdigitaldnyan
 
Programming for data science in python
Programming for data science in pythonProgramming for data science in python
Programming for data science in pythonUmmeSalmaM1
 
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioIntroduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioMuralidharan Deenathayalan
 
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioIntroduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioMuralidharan Deenathayalan
 
Simple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptxSimple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptxYashSharma357857
 
What Is The BEST WAY TO LEARN PYTHON In 2023.pptx
What Is The BEST WAY TO LEARN PYTHON In 2023.pptxWhat Is The BEST WAY TO LEARN PYTHON In 2023.pptx
What Is The BEST WAY TO LEARN PYTHON In 2023.pptxcalltutors
 
Python presentation by Monu Sharma
Python presentation by Monu SharmaPython presentation by Monu Sharma
Python presentation by Monu SharmaMayank Sharma
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its ApplicationsAbhijeet Singh
 
Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Sapna Tyagi
 
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningApresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningArthur Emanuel
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()Blue Elephant Consulting
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxlemonchoos
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialQA TrainingHub
 
Introduction of python programming
Introduction of python programmingIntroduction of python programming
Introduction of python programmingNitin Kumar Kashyap
 
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)Amazon Web Services
 

Similar to A first taste of Python and Django (20)

Welcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdfWelcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdf
 
Welcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdfWelcome to Python Programming Language.pdf
Welcome to Python Programming Language.pdf
 
Welcome to Python Programming Language.pptx
Welcome to Python Programming Language.pptxWelcome to Python Programming Language.pptx
Welcome to Python Programming Language.pptx
 
Programming for data science in python
Programming for data science in pythonProgramming for data science in python
Programming for data science in python
 
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioIntroduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
 
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioIntroduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
 
Simple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptxSimple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptx
 
What Is The BEST WAY TO LEARN PYTHON In 2023.pptx
What Is The BEST WAY TO LEARN PYTHON In 2023.pptxWhat Is The BEST WAY TO LEARN PYTHON In 2023.pptx
What Is The BEST WAY TO LEARN PYTHON In 2023.pptx
 
Python presentation by Monu Sharma
Python presentation by Monu SharmaPython presentation by Monu Sharma
Python presentation by Monu Sharma
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
 
Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425
 
ppt summer training ug.pptx
ppt summer training ug.pptxppt summer training ug.pptx
ppt summer training ug.pptx
 
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningApresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
 
Learn python
Learn pythonLearn python
Learn python
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 
Python
PythonPython
Python
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
 
Introduction of python programming
Introduction of python programmingIntroduction of python programming
Introduction of python programming
 
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
 

Recently uploaded

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

A first taste of Python and Django

  • 1. Python and Django A first taste
  • 2. What is Python? • General purpose, interpreted • Supports procedural, object oriented, functional paradigms • Easy for newcomers
  • 3. Python Used in many application domains: web development, gaming, animation, scientific computing, robotics, spacecraft control, desktop applications, testing microchips … Google, Youtube, Disqus, Reddit, Dropbox, Disney, Pixar, Nasa, Rasberry Pi, Intel …
  • 4. Python philosophy • Readable code “Code is read much more often than it is written” • Developer productivity, built-in toolset Large standard library / third party libraries
  • 5. Whitespace is important if 1 < 2:
 print 'Numbers behaving normally'
 
 
 def my_function(a, b):
 return a + b
 my_function(2, 3)
  • 6. Get up and running with Python quickly • Free online book: “Dive Into Python” • Try out the interpreter
  • 7. $ python Python 2.7.6 (default, Sep 9 2014, 15:04:36) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>
  • 8. >>> 5 + 4 9 >>> name = 'Ellen' >>> print name Ellen >>>
  • 9. Modules and Packages import module import package.module PyPi - Python Package index. Over 56,000 packages pip - python package manger pip install package-name pip install -r requirements.txt pip freeze > requirements.txt
  • 10. Virtual Machine Develop in the same environment, on the same OS as your web server Virtual Environment Keep the dependencies required by different projects in separate places.
  • 11. Debugging with pdb / ipdb Interactive source code debugger Supports • stepping though code • setting conditional breakpoints • printing values • evaluating python code import ipdb ipdb.set_trace()
  • 13. Web development with Django framework MVC Django deals with Models Models data Controllers Views what you see Views Templates how you see it
  • 14. Django • Reusable modules = ‘apps’ • ORM (Object-Relational Mapping) • Templating • Routing • Forms library
  • 16. • What python is and what it’s used for • How to start with python • Libraries - modules and packages • Development environment • Web development framework Django