SlideShare a Scribd company logo
PiTechnologies

  Tudor Prodan
    March 2009
Python @ PiTech - March 2009
What is Python

- a “very high-level language”
- developed by Guido van Rossum
- main features:

    simple, yet powerful semantics
    object-oriented, but multi-paradigm
    clean syntax and coherent design
    focus on productivity
    rich standard library
    lots of high quality 3rd-party
    several good implementations:
     CPython, Pypy, IronPython (2.0.1), PyS60, Jython
Jython


Jython, lest you do not know of it, is the most
compelling weapon the Java platform has for its
survival into the 21st century :-)

                         —Sean McGrath, CTO, Propylon
                                        July 31, 2003
CPython

Version   history:
    1.0   – Jan 1994
    2.0   – Oct 2000
    3.0   – Dec 2008

Latest stable versions:
    2.6.1 and 3.0.1

Usable versions:
    2.5.x
    2.6.x = 2.5 + improvements + 3.0 features
                                 (__future__)
    | | |__ maintenance version
    | |____ minor version
    |______ major version
Why Python?
Python @ PiTech - March 2009
Python @ PiTech - March 2009
Why Python

 programming is fun again
Unfinished game

The problem of the unfinished game:

Let's say, hypothetically speaking,
you met someone who told you they had two children,
and one of them is a girl.

What are the odds that person has a boy and a girl?


                      -Jeff Atwood, December 30, 2008
                     http://www.codinghorror.com/blog
Unfinished game

Java
Unfinished game

C#
Unfinished game

Python
Unfinished game


         LoC   readable?   fun?

Java     53    barely      nope

C#       49    kind of     not really

Python   10    clean,      much more fun
               concise     than the above
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
Why Python


Java is the COBOL of the 21st century.

                                -Sean Kelly, JPL, NASA
Spirit of C

Python is close to the “Spirit of C” (more than C++/
Java/...), as per ISO C Standard's “rationale”:

 trust the programmer
 don't prevent the programmer from doing what needs
to be done
 keep the language small and simple
 provide only one way to do an operation
 make it fast, even if it's not guaranteed to be
portable (the only bit not @100% in Python)
Python vs. C(++,#)/Java/..

 everything is a first-class object
   - functions, methods, modules, ..

 typing: strong, but dynamic
   - names have no type, objects have types

 no “declarations”, just statements
   - implicit compilation, .pyc files
   - everything is run-time (compile-time too)

 spare syntax,   minimal ornamentation
   - no { } for   blocks
   - no ( ) for   conditions
   - a lot less   punctuation
Python vs. C(++,#)/Java/..

In the 1960's the KGB was very interested in learning everything
possible about the American space program, sending all sorts of
spies to find every possible piece of information.

One afternoon, a breathless spy returned to headquarters with a
piece of paper in his hand, excitedly shouting to his superior,
"Comrade! Comrade! The Americans are using Lisp to write their
rocket launching software!“

The commander was skeptical. "How do you know?"

"I broke into their research lab and stole a page from the
teletype machine! It's not the whole program, but it's the final
page and contains the concluding logic of the program! See for
yourself!"

The commander looked at the page and smiled:
Python vs. C(++,#)/Java/..

))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))
)))))))))))))))))))))))))
))))))))))))))))))))))
))))))))))))))))))))
))))))))))))))))
)))))))))))))))
)))))))))))
))))
)))
))
))
)
Why Python

Example #2:

Create a Coordinate class
which holds a latitude and longitude,
to be used by a TelemetryTracker object.
Why Python


this example will show
    Python vs. Java

but is actually
    Python vs. Java / C# / PHP / (most others)
Why Python

Java:
Philosophy



You know you've reached perfection in design, not
when you have nothing more to add, but when you have
nothing more to take away.

                            -Antoine de Saint Exupery
Why Python

Java:        Python:
Why Python

The Java guys will say:

 my IDE can generate most of that
  - code is read a lot more than written
Why Python

The Java guys will say:

 my IDE can generate most of that
  - code is read a lot more than written

 but, your fields are public
  - Python philosophy
Why Python

The Java guys will say:

 my IDE can generate most of that
  - code is read a lot more than written

 but, your fields are public
  - Python philosophy

 can't we apply this to other languages?
Why Python

Java:        Python:
Why Python

Eventually, the code will end up in production..

Java:                      Python:
Why Python

.. time passes ..
Why Python

.. time passes ..

Eventually,
    decodeLat receives bad data

This is a bug!

What do we do?

 - add a check
Why Python

Add a setter and a getter:
Why Python

Add a setter and a getter:




Let's try it out:
Why Python


and the TelemetryTracker code:

Python:
    - still works


Java:
    - needs modification
Why Python


in the end:

Python:
    - gives you a choice
    - you can even change your mind

Java/C#/PHP/..:
    - no choice
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
Why Python

Python has
lots &
LOTS
of good
books:
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
   good documentation (lots of books)
   good support: lots of forums, mailing lists, IRC
Python @ PiTech - March 2009
Why Python

Large number of high quality 3rd-party libraries and
frameworks:

- networking: twisted, cogen, concurrence
- scientific: NumPy, ScyPy, PyEvolve (genetic algorithms)
- testing: PyUnit, Google Mox
- fuzzing: Fuzz
- database: SQLAlchemy, Elixir, Django ORM
- web crawling: BeautifulSoup, lxml, Scrappy
- game development: PyGame
- GUI: PyGTK, wxPython, PyQt, GTK#
-templating: Genshi, Mako, Kid, Jinja2
- cryptography: M2Crypto, PyCrypto, Keyczar,

.. many, many others
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
   good documentation (lots of books)
   good support: lots of forums, IRC, mailing lists
   lots of high quality 3rd-party libraries
Why Python

But most interesting to us,
lots of great web frameworks:
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
   good documentation (lots of books)
   good support: lots of forums, IRC, mailing lists
   lots of high quality 3rd-party libraries
   many great web frameworks
Python @ PiTech - March 2009

More Related Content

ODP
Learn python
PDF
Python in real world.
PPTX
Python programming | Fundamentals of Python programming
PDF
Introduction to python
PDF
Introduction to python
PDF
Welcome to Python
PDF
Python
PDF
A Python Tutorial
Learn python
Python in real world.
Python programming | Fundamentals of Python programming
Introduction to python
Introduction to python
Welcome to Python
Python
A Python Tutorial

What's hot (20)

PDF
开源沙龙第一期 Python intro
PPT
Why I Love Python
PDF
Profiling and optimizing RAM and CPU use in RMG-Py
PDF
Python: the Project, the Language and the Style
PPTX
Introduction to python programming, Why Python?, Applications of Python
PDF
Writing Fast Code (JP) - PyCon JP 2015
PPTX
First python project
PPTX
Top 10 python ide
PPT
Python Introduction
PDF
Python for the Mobile and Web
PDF
Pythonanditsapplications 161121160425
PPTX
Hello World! with Python
PDF
Python basics_ part1
PDF
Python Workshop
PPTX
Introduction to Python
PDF
Python in programming competitions
ODP
Python and Machine Learning
PDF
Ry pyconjp2015 karaoke
PDF
Introduction to python 3 2nd round
PDF
pyconjp2015_talk_Translation of Python Program__
开源沙龙第一期 Python intro
Why I Love Python
Profiling and optimizing RAM and CPU use in RMG-Py
Python: the Project, the Language and the Style
Introduction to python programming, Why Python?, Applications of Python
Writing Fast Code (JP) - PyCon JP 2015
First python project
Top 10 python ide
Python Introduction
Python for the Mobile and Web
Pythonanditsapplications 161121160425
Hello World! with Python
Python basics_ part1
Python Workshop
Introduction to Python
Python in programming competitions
Python and Machine Learning
Ry pyconjp2015 karaoke
Introduction to python 3 2nd round
pyconjp2015_talk_Translation of Python Program__
Ad

Viewers also liked (16)

PDF
Actividad de aprendizaje 9
PPTX
Social network
DOC
Lebenslauf
PDF
Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
PPTX
Pasos para-hacer-una-buena-presentación
PDF
DOCX
Kim CV Mar 2015
PPTX
Welcome to the world of graphics design
PPTX
ΔΩΡΕΑΝ ιατρικές εξετάσεις
PDF
Proposal lezara
PPTX
Why doing a DEVA now is the best option
PPT
Anxiety disorder treatment
PDF
Grafitalia 2013
PPSX
приём в октябрята
PPTX
CliqTags - Säljpresentation
PPTX
Actividad de aprendizaje 9
Social network
Lebenslauf
Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
Pasos para-hacer-una-buena-presentación
Kim CV Mar 2015
Welcome to the world of graphics design
ΔΩΡΕΑΝ ιατρικές εξετάσεις
Proposal lezara
Why doing a DEVA now is the best option
Anxiety disorder treatment
Grafitalia 2013
приём в октябрята
CliqTags - Säljpresentation
Ad

Similar to Python @ PiTech - March 2009 (20)

PPTX
IPT 2.pptx
PPTX
What is python
PPTX
Introduction to Python Programming Basics
PPT
Python for students step by step guidance
PPT
Python Programming Unit1_Aditya College of Engg & Tech
PPT
Why Python
PPTX
Introduction to Python.pptx
PPT
1-ppt-python.ppt
PDF
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
PPTX
Programming in python in detail concept .pptx
PPTX
Python.pptx
PPTX
All you need to know about Python | BJIT
PPTX
Python Programming Language
PPTX
11 Unit1 Chapter 1 Getting Started With Python
DOCX
Python Programming and ApplicationsUnit-1.docx
PPTX
Basic Python Introduction Lecture 1.pptx
PDF
Migration of Applications to Python is the most prudent Decision
PPTX
Chapter 8 getting started with python
PPTX
Lecture 1.pptx
IPT 2.pptx
What is python
Introduction to Python Programming Basics
Python for students step by step guidance
Python Programming Unit1_Aditya College of Engg & Tech
Why Python
Introduction to Python.pptx
1-ppt-python.ppt
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
Programming in python in detail concept .pptx
Python.pptx
All you need to know about Python | BJIT
Python Programming Language
11 Unit1 Chapter 1 Getting Started With Python
Python Programming and ApplicationsUnit-1.docx
Basic Python Introduction Lecture 1.pptx
Migration of Applications to Python is the most prudent Decision
Chapter 8 getting started with python
Lecture 1.pptx

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
The AUB Centre for AI in Media Proposal.docx
NewMind AI Monthly Chronicles - July 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
Per capita expenditure prediction using model stacking based on satellite ima...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
Understanding_Digital_Forensics_Presentation.pptx
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology

Python @ PiTech - March 2009

  • 1. PiTechnologies Tudor Prodan March 2009
  • 3. What is Python - a “very high-level language” - developed by Guido van Rossum - main features:  simple, yet powerful semantics  object-oriented, but multi-paradigm  clean syntax and coherent design  focus on productivity  rich standard library  lots of high quality 3rd-party  several good implementations: CPython, Pypy, IronPython (2.0.1), PyS60, Jython
  • 4. Jython Jython, lest you do not know of it, is the most compelling weapon the Java platform has for its survival into the 21st century :-) —Sean McGrath, CTO, Propylon July 31, 2003
  • 5. CPython Version history: 1.0 – Jan 1994 2.0 – Oct 2000 3.0 – Dec 2008 Latest stable versions: 2.6.1 and 3.0.1 Usable versions: 2.5.x 2.6.x = 2.5 + improvements + 3.0 features (__future__) | | |__ maintenance version | |____ minor version |______ major version
  • 10. Unfinished game The problem of the unfinished game: Let's say, hypothetically speaking, you met someone who told you they had two children, and one of them is a girl. What are the odds that person has a boy and a girl? -Jeff Atwood, December 30, 2008 http://www.codinghorror.com/blog
  • 14. Unfinished game LoC readable? fun? Java 53 barely nope C# 49 kind of not really Python 10 clean, much more fun concise than the above
  • 15. Why Python  programming is fun again  agility  elegance  you don't have to fight the language
  • 16. Why Python Java is the COBOL of the 21st century. -Sean Kelly, JPL, NASA
  • 17. Spirit of C Python is close to the “Spirit of C” (more than C++/ Java/...), as per ISO C Standard's “rationale”:  trust the programmer  don't prevent the programmer from doing what needs to be done  keep the language small and simple  provide only one way to do an operation  make it fast, even if it's not guaranteed to be portable (the only bit not @100% in Python)
  • 18. Python vs. C(++,#)/Java/..  everything is a first-class object - functions, methods, modules, ..  typing: strong, but dynamic - names have no type, objects have types  no “declarations”, just statements - implicit compilation, .pyc files - everything is run-time (compile-time too)  spare syntax, minimal ornamentation - no { } for blocks - no ( ) for conditions - a lot less punctuation
  • 19. Python vs. C(++,#)/Java/.. In the 1960's the KGB was very interested in learning everything possible about the American space program, sending all sorts of spies to find every possible piece of information. One afternoon, a breathless spy returned to headquarters with a piece of paper in his hand, excitedly shouting to his superior, "Comrade! Comrade! The Americans are using Lisp to write their rocket launching software!“ The commander was skeptical. "How do you know?" "I broke into their research lab and stole a page from the teletype machine! It's not the whole program, but it's the final page and contains the concluding logic of the program! See for yourself!" The commander looked at the page and smiled:
  • 21. Why Python Example #2: Create a Coordinate class which holds a latitude and longitude, to be used by a TelemetryTracker object.
  • 22. Why Python this example will show Python vs. Java but is actually Python vs. Java / C# / PHP / (most others)
  • 24. Philosophy You know you've reached perfection in design, not when you have nothing more to add, but when you have nothing more to take away. -Antoine de Saint Exupery
  • 25. Why Python Java: Python:
  • 26. Why Python The Java guys will say:  my IDE can generate most of that - code is read a lot more than written
  • 27. Why Python The Java guys will say:  my IDE can generate most of that - code is read a lot more than written  but, your fields are public - Python philosophy
  • 28. Why Python The Java guys will say:  my IDE can generate most of that - code is read a lot more than written  but, your fields are public - Python philosophy  can't we apply this to other languages?
  • 29. Why Python Java: Python:
  • 30. Why Python Eventually, the code will end up in production.. Java: Python:
  • 31. Why Python .. time passes ..
  • 32. Why Python .. time passes .. Eventually, decodeLat receives bad data This is a bug! What do we do? - add a check
  • 33. Why Python Add a setter and a getter:
  • 34. Why Python Add a setter and a getter: Let's try it out:
  • 35. Why Python and the TelemetryTracker code: Python: - still works Java: - needs modification
  • 36. Why Python in the end: Python: - gives you a choice - you can even change your mind Java/C#/PHP/..: - no choice
  • 37. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you
  • 38. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you
  • 39. Why Python Python has lots & LOTS of good books:
  • 40. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you  good documentation (lots of books)  good support: lots of forums, mailing lists, IRC
  • 42. Why Python Large number of high quality 3rd-party libraries and frameworks: - networking: twisted, cogen, concurrence - scientific: NumPy, ScyPy, PyEvolve (genetic algorithms) - testing: PyUnit, Google Mox - fuzzing: Fuzz - database: SQLAlchemy, Elixir, Django ORM - web crawling: BeautifulSoup, lxml, Scrappy - game development: PyGame - GUI: PyGTK, wxPython, PyQt, GTK# -templating: Genshi, Mako, Kid, Jinja2 - cryptography: M2Crypto, PyCrypto, Keyczar, .. many, many others
  • 43. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you  good documentation (lots of books)  good support: lots of forums, IRC, mailing lists  lots of high quality 3rd-party libraries
  • 44. Why Python But most interesting to us, lots of great web frameworks:
  • 45. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you  good documentation (lots of books)  good support: lots of forums, IRC, mailing lists  lots of high quality 3rd-party libraries  many great web frameworks