SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
What is Python?

      Wesly Chun, Google IO 2011


                  May 11, 2011




Wesly Chun, Google IO 2011   What is Python?
About Guido van Rossum




     Creator of Python (BDFL)
     Software Engineer at Google
     Google App Engine
         Python libraries, API design
         UI programming, developer tools
     22+ years of Python




              Wesly Chun, Google IO 2011   What is Python?
Python in a Nutshell




      General-purpose programming language
      Object-oriented
      Scripting or mission-critical servers
      Interpreted but bytecode-compiled
      Simple yet robust syntax
      Easy-to-read, -learn, -maintain
      Batteries included




                Wesly Chun, Google IO 2011   What is Python?
Python is now twenty!




             Wesly Chun, Google IO 2011   What is Python?
Gains in popularity




      Jump in job listings
      Safari Top 5 Queries, Apr 2009
          iPhone
          Java
          Python
          C#
          PHP
               Source: Safari Books Online (O’Reilly, Pearson)




               Wesly Chun, Google IO 2011   What is Python?
Fan Favorite



      Tiobe Language of the Year (2010, 2007)
          www.tiobe.com
          Alternates between #6 and #7 (vs. Objective-C)
      LinuxJournal
          Favorite Programming Language (2010, 2009)
          Favorite Scripting Language (2010, 2008, 2007, 2006)
          linuxjournal.com
      LinuxQuestions.org Members Choice Awards
          Language of the Year (2010, 2009, 2008, 2007)
          linuxquestions.org




               Wesly Chun, Google IO 2011   What is Python?
Gaining more mindshare


     Google App Engine announcement
         Launches with Python
         Parts of Django framework
     Change at MIT
         Switches from Scheme to Python
         Focuses on Robotics
         MITx: 6.00x Introduction to Computer Science and
         Programming at edx.org
              Learn how to write programs that solve problems
              Skill can be transferred to any programming language
     Think Python: How to think like a computer scientist
         Ability to formulate problems, think creatively about solutions,
         and express a solution clearly and accurately
         http://www.greenteapress.com/thinkpython/



              Wesly Chun, Google IO 2011   What is Python?
Python & Education



     Heavily inspired by ABC
         Simplistic yet robust syntax
     Computer Programming for Everybody (CP4E)
         Programming as a basic skill
     High School Success Story
         Computer Science Advanced Placement Exam
         Python helped with retention/understanding
     interactivepython.org
     pythontutor.com




               Wesly Chun, Google IO 2011   What is Python?
Programming Languages




     Adults: tools to get work done
         C/C++/C#, Java, PHP, Python, Ruby
     Kids: used to teach programming
         Scratch, Alice, Python, Basic, Flash/AS
     Conclusion: if made for kids...




               Wesly Chun, Google IO 2011   What is Python?
Demo


1    def foo ():
2        factor = 10
3        try :
4              f = open ( ’ data . txt ’ , ’w ’)
5        except IOError as e :
6              print ’ file open error ’ , e
7              return
8
9         for i in range (10): # ( int i =0; i <10; i ++)
10              print >> f , i + factor ,
11              if i % 2 == 0:
12                   print >> f , ’ even ’
13              else :
14                   print >> f , ’ odd ’
15        f . close ()




                    Wesly Chun, Google IO 2011   What is Python?
Demo (improved version)



1    def foo ():
2        factor = 10
3        with open ( ’ data . txt ’ , ’w ’) as f :
4             for i in range (10):
5                 if i % 2 == 0:
6                       num = ’ even ’
7                 else :
8                       num = ’ odd ’
9                 # old string formatting
10                # f . write ("% d , % s  n " % ( i + factor , num ))
11
12                  f . write ( " {0} , {1} n " . format ( i + factor , num ))




                    Wesly Chun, Google IO 2011   What is Python?
Output


                                      data.txt
  10 ,   even
  11 ,   odd
  12 ,   even
  13 ,   odd
  14 ,   even
  15 ,   odd
  16 ,   even
  17 ,   odd
  18 ,   even
  19 ,   odd




                Wesly Chun, Google IO 2011   What is Python?
Well-known projects


     NumPy, SciPy, Matplotlib
     Jython, IronPython, PyPy
     virtualenv
     SQLAlchemy
     nose, py.test
     windmill, Selenium
     BeautfilSoup, html5lib, lxml
     IPython, bpython
     Sphinx, ReportLab
     Python Extensios for Windows



                  Wesly Chun, Google IO 2011   What is Python?
NumPy, SciPy & Matplotlib example
1    import numpy
2    import scipy . special
3    import matplotlib . pyplot as mpl
4    # compute Bezzel function
5    x , y = numpy . mgrid [ -25:25:100 j , -25:25:100 j ]
6    r = numpy . sqrt ( x **2 + y **2)
7    B = scipy . special . j0 ( r )
8    # now do plotting
9    mpl . contourf (x , y , B )
10   mpl . colorbar ()
11   mpl . show ()




                   Wesly Chun, Google IO 2011   What is Python?
Web frameworks

     Django
     TurboGears, Pylons, repoze.bfg, Pyramid
     web2py
     web.py
     Google App’s Engine webapp
     Werkzeug, Flask, Tipfy
     Zope, Plone
     Tornado
     etc.
     ”Python: the only language with more web frameworks that
     keywords.”
         Harald Armin Massa, 2005
         groups.google.com/group/comp.lang.python/msg


               Wesly Chun, Google IO 2011   What is Python?
Python used for...


      Networking
      Web/RIA apps
      QA/testing, automation frameworks
      Text Processing
      Database Programming
      Scientific, mathematical/numeric processing
      Hardware/embedded system design
      Multimedia, graphics/imaging, animation
      GUI development
      Java, .NET, COM/MFC
      Batteries included


                Wesly Chun, Google IO 2011   What is Python?
Python @ ???


     Google
     Yahoo!
     Dropbox
     Disney, Pixar, Dreamworks
     Lucas: Lucasfilm, ILM, LucasArts
     VMware, Broadcom, QNX
     Evite, eventbrite, Justin.tv
     Yelp, Tripit, Zillow, Netflix
     Red Hat, Ubuntu/Canonical, OLPC, Raspberry Pi
     NASA, NOAA (NWS), NSA
     etc.


               Wesly Chun, Google IO 2011   What is Python?
Python and Google




     An official language
         Can deploy to production servers
     C++ primary development language
         Need for systems/scripting language
     Java came later




              Wesly Chun, Google IO 2011   What is Python?
History @ Google



     Use of Python before company founded
     ”In order to scale hundreds of millions of web pages, Google
     has a fast distributed crawling system. A single URLserver
     serves... URLs to a number of crawlers... Both the URLserver
     and the crawlers are implemented in Python.”
         From ”Anatomy of a Large-Scale Hypertextual Web Search
         Engine”
         S. Brin & L. Page, Stanford University, 1998
         infolab.stanford.edu/ backrub/google.html




              Wesly Chun, Google IO 2011   What is Python?
Another quote




  ”Python has been an important part of Google since the
  beginning, and remains so as the system grows and evolves.”
  – Peter Norvig, Director of Research at Google




                Wesly Chun, Google IO 2011   What is Python?
Products using Python




     Google App Engine
     YouTube (flexibility, rapid development, simplicity)
     code.google.com
     Various open source libraries




               Wesly Chun, Google IO 2011   What is Python?
Other uses of Python



     Build system
     System administration tools
         Monitoring, managing systems
         Log anaylsis
         Report generation
     Code review tool
     QA/testing
     Automation
     Extensive use of SWIG
     App Engine apps




              Wesly Chun, Google IO 2011   What is Python?
Two versions of Python




     Python 2: current version
     Python 3: next generation
     Language evolving
     Backwards-incompatible
     Insert FUD here
     No community fragmentation




              Wesly Chun, Google IO 2011   What is Python?
Hello World (again)


        Python 2.x
1   print ’ Hello World ! ’



        Python 3.x
1   print ( ’ Hello World ! ’)



        Or use the standard file methods
1   import sys
2   sys . stdout . write ( ’ Hello World ! n ’)




                   Wesly Chun, Google IO 2011   What is Python?
Which to start with?




      Python 3.x: next generation
          Do this if completely new
      Python 2.x: current version
          Most books/tutorials still here
          Do this if have existing software
      Bottom-line: either is fine




                Wesly Chun, Google IO 2011   What is Python?
That’s all folks




               Wesly Chun, Google IO 2011   What is Python?

Mais conteúdo relacionado

Mais procurados

Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Sapna Tyagi
 
Python intro
Python introPython intro
Python introrik0
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaEdureka!
 
Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Younggun Kim
 
Python for the Mobile and Web
Python for the Mobile and WebPython for the Mobile and Web
Python for the Mobile and WebDerek Kiong
 
Python, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersPython, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersBoey Pak Cheong
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingRanel Padon
 
Python presentation by Monu Sharma
Python presentation by Monu SharmaPython presentation by Monu Sharma
Python presentation by Monu SharmaMayank Sharma
 
Python for Big Data Analytics
Python for Big Data AnalyticsPython for Big Data Analytics
Python for Big Data AnalyticsEdureka!
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshopamptiny
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On PythonShivam Gupta
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Edureka!
 
Why Python is better for Data Science
Why Python is better for Data ScienceWhy Python is better for Data Science
Why Python is better for Data ScienceÍcaro Medeiros
 
1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on python1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on pythonSANTOSHJAISWAL52
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 courseHimanshuPanwar38
 
The str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOLThe str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOLKir Chou
 
Benefits & features of python |Advantages & disadvantages of python
Benefits & features of python |Advantages & disadvantages of pythonBenefits & features of python |Advantages & disadvantages of python
Benefits & features of python |Advantages & disadvantages of pythonparadisetechsoftsolutions
 

Mais procurados (20)

Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425
 
Python intro
Python introPython intro
Python intro
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
 
Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015
 
Python for the Mobile and Web
Python for the Mobile and WebPython for the Mobile and Web
Python for the Mobile and Web
 
Python, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersPython, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for Engineers
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI Programming
 
Python presentation by Monu Sharma
Python presentation by Monu SharmaPython presentation by Monu Sharma
Python presentation by Monu Sharma
 
Python for Big Data Analytics
Python for Big Data AnalyticsPython for Big Data Analytics
Python for Big Data Analytics
 
Python
PythonPython
Python
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshop
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On Python
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
 
Why Python is better for Data Science
Why Python is better for Data ScienceWhy Python is better for Data Science
Why Python is better for Data Science
 
1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on python1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on python
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
 
Python tutorial
Python tutorialPython tutorial
Python tutorial
 
The str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOLThe str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOL
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Benefits & features of python |Advantages & disadvantages of python
Benefits & features of python |Advantages & disadvantages of pythonBenefits & features of python |Advantages & disadvantages of python
Benefits & features of python |Advantages & disadvantages of python
 

Semelhante a What is Python?

Python 101 For The Net Developer
Python 101 For The Net DeveloperPython 101 For The Net Developer
Python 101 For The Net DeveloperSarah Dutkiewicz
 
Behold the Power of Python
Behold the Power of PythonBehold the Power of Python
Behold the Power of PythonSarah Dutkiewicz
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE teachersduniya.com
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)guobichrng
 
WTF is Python
WTF is PythonWTF is Python
WTF is Pythonsneeu
 
Mastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMalcolmDupri
 
Python and Its fascinating applications in the real world.pdf
Python and Its fascinating applications in the real world.pdfPython and Its fascinating applications in the real world.pdf
Python and Its fascinating applications in the real world.pdfSkilloVilla
 
Basic Python Introduction Lecture 1.pptx
Basic Python Introduction Lecture 1.pptxBasic Python Introduction Lecture 1.pptx
Basic Python Introduction Lecture 1.pptxAditya Patel
 
Python 101 for the .NET Developer
Python 101 for the .NET DeveloperPython 101 for the .NET Developer
Python 101 for the .NET DeveloperSarah Dutkiewicz
 
Python programming for beginners
Python programming for beginnersPython programming for beginners
Python programming for beginnersBenishchoco
 
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
 

Semelhante a What is Python? (20)

Python 101 For The Net Developer
Python 101 For The Net DeveloperPython 101 For The Net Developer
Python 101 For The Net Developer
 
Behold the Power of Python
Behold the Power of PythonBehold the Power of Python
Behold the Power of Python
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE
 
Learn Python in Pragmatic Way
Learn Python in Pragmatic WayLearn Python in Pragmatic Way
Learn Python in Pragmatic Way
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)
 
WTF is Python
WTF is PythonWTF is Python
WTF is Python
 
Mastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions Demystified
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Python and Its fascinating applications in the real world.pdf
Python and Its fascinating applications in the real world.pdfPython and Its fascinating applications in the real world.pdf
Python and Its fascinating applications in the real world.pdf
 
Basic Python Introduction Lecture 1.pptx
Basic Python Introduction Lecture 1.pptxBasic Python Introduction Lecture 1.pptx
Basic Python Introduction Lecture 1.pptx
 
Python basic
Python basicPython basic
Python basic
 
what is python ?
what is python ? what is python ?
what is python ?
 
Python ppt
Python pptPython ppt
Python ppt
 
Python Class 1
Python Class 1Python Class 1
Python Class 1
 
Python 101 for the .NET Developer
Python 101 for the .NET DeveloperPython 101 for the .NET Developer
Python 101 for the .NET Developer
 
Python programming for beginners
Python programming for beginnersPython programming for beginners
Python programming for beginners
 
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
 

Mais de Eduardo Bergavera

CLP Session 5 - The Christian Family
CLP Session 5 - The Christian FamilyCLP Session 5 - The Christian Family
CLP Session 5 - The Christian FamilyEduardo Bergavera
 
Chapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismChapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismEduardo Bergavera
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and OutputEduardo Bergavera
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and SearchingChapter 11 - Sorting and Searching
Chapter 11 - Sorting and SearchingEduardo Bergavera
 
Chapter 9 - Characters and Strings
Chapter 9 - Characters and StringsChapter 9 - Characters and Strings
Chapter 9 - Characters and StringsEduardo Bergavera
 
Chapter 8 - Exceptions and Assertions Edit summary
Chapter 8 - Exceptions and Assertions  Edit summaryChapter 8 - Exceptions and Assertions  Edit summary
Chapter 8 - Exceptions and Assertions Edit summaryEduardo Bergavera
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIEduardo Bergavera
 
Chapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IChapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IEduardo Bergavera
 
Chapter 2 - Getting Started with Java
Chapter 2 - Getting Started with JavaChapter 2 - Getting Started with Java
Chapter 2 - Getting Started with JavaEduardo Bergavera
 
Chapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software DevelopmentChapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software DevelopmentEduardo Bergavera
 

Mais de Eduardo Bergavera (10)

CLP Session 5 - The Christian Family
CLP Session 5 - The Christian FamilyCLP Session 5 - The Christian Family
CLP Session 5 - The Christian Family
 
Chapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismChapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and Polymorphism
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and Output
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and SearchingChapter 11 - Sorting and Searching
Chapter 11 - Sorting and Searching
 
Chapter 9 - Characters and Strings
Chapter 9 - Characters and StringsChapter 9 - Characters and Strings
Chapter 9 - Characters and Strings
 
Chapter 8 - Exceptions and Assertions Edit summary
Chapter 8 - Exceptions and Assertions  Edit summaryChapter 8 - Exceptions and Assertions  Edit summary
Chapter 8 - Exceptions and Assertions Edit summary
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part II
 
Chapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IChapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part I
 
Chapter 2 - Getting Started with Java
Chapter 2 - Getting Started with JavaChapter 2 - Getting Started with Java
Chapter 2 - Getting Started with Java
 
Chapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software DevelopmentChapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software Development
 

What is Python?

  • 1. What is Python? Wesly Chun, Google IO 2011 May 11, 2011 Wesly Chun, Google IO 2011 What is Python?
  • 2. About Guido van Rossum Creator of Python (BDFL) Software Engineer at Google Google App Engine Python libraries, API design UI programming, developer tools 22+ years of Python Wesly Chun, Google IO 2011 What is Python?
  • 3. Python in a Nutshell General-purpose programming language Object-oriented Scripting or mission-critical servers Interpreted but bytecode-compiled Simple yet robust syntax Easy-to-read, -learn, -maintain Batteries included Wesly Chun, Google IO 2011 What is Python?
  • 4. Python is now twenty! Wesly Chun, Google IO 2011 What is Python?
  • 5. Gains in popularity Jump in job listings Safari Top 5 Queries, Apr 2009 iPhone Java Python C# PHP Source: Safari Books Online (O’Reilly, Pearson) Wesly Chun, Google IO 2011 What is Python?
  • 6. Fan Favorite Tiobe Language of the Year (2010, 2007) www.tiobe.com Alternates between #6 and #7 (vs. Objective-C) LinuxJournal Favorite Programming Language (2010, 2009) Favorite Scripting Language (2010, 2008, 2007, 2006) linuxjournal.com LinuxQuestions.org Members Choice Awards Language of the Year (2010, 2009, 2008, 2007) linuxquestions.org Wesly Chun, Google IO 2011 What is Python?
  • 7. Gaining more mindshare Google App Engine announcement Launches with Python Parts of Django framework Change at MIT Switches from Scheme to Python Focuses on Robotics MITx: 6.00x Introduction to Computer Science and Programming at edx.org Learn how to write programs that solve problems Skill can be transferred to any programming language Think Python: How to think like a computer scientist Ability to formulate problems, think creatively about solutions, and express a solution clearly and accurately http://www.greenteapress.com/thinkpython/ Wesly Chun, Google IO 2011 What is Python?
  • 8. Python & Education Heavily inspired by ABC Simplistic yet robust syntax Computer Programming for Everybody (CP4E) Programming as a basic skill High School Success Story Computer Science Advanced Placement Exam Python helped with retention/understanding interactivepython.org pythontutor.com Wesly Chun, Google IO 2011 What is Python?
  • 9. Programming Languages Adults: tools to get work done C/C++/C#, Java, PHP, Python, Ruby Kids: used to teach programming Scratch, Alice, Python, Basic, Flash/AS Conclusion: if made for kids... Wesly Chun, Google IO 2011 What is Python?
  • 10. Demo 1 def foo (): 2 factor = 10 3 try : 4 f = open ( ’ data . txt ’ , ’w ’) 5 except IOError as e : 6 print ’ file open error ’ , e 7 return 8 9 for i in range (10): # ( int i =0; i <10; i ++) 10 print >> f , i + factor , 11 if i % 2 == 0: 12 print >> f , ’ even ’ 13 else : 14 print >> f , ’ odd ’ 15 f . close () Wesly Chun, Google IO 2011 What is Python?
  • 11. Demo (improved version) 1 def foo (): 2 factor = 10 3 with open ( ’ data . txt ’ , ’w ’) as f : 4 for i in range (10): 5 if i % 2 == 0: 6 num = ’ even ’ 7 else : 8 num = ’ odd ’ 9 # old string formatting 10 # f . write ("% d , % s n " % ( i + factor , num )) 11 12 f . write ( " {0} , {1} n " . format ( i + factor , num )) Wesly Chun, Google IO 2011 What is Python?
  • 12. Output data.txt 10 , even 11 , odd 12 , even 13 , odd 14 , even 15 , odd 16 , even 17 , odd 18 , even 19 , odd Wesly Chun, Google IO 2011 What is Python?
  • 13. Well-known projects NumPy, SciPy, Matplotlib Jython, IronPython, PyPy virtualenv SQLAlchemy nose, py.test windmill, Selenium BeautfilSoup, html5lib, lxml IPython, bpython Sphinx, ReportLab Python Extensios for Windows Wesly Chun, Google IO 2011 What is Python?
  • 14. NumPy, SciPy & Matplotlib example 1 import numpy 2 import scipy . special 3 import matplotlib . pyplot as mpl 4 # compute Bezzel function 5 x , y = numpy . mgrid [ -25:25:100 j , -25:25:100 j ] 6 r = numpy . sqrt ( x **2 + y **2) 7 B = scipy . special . j0 ( r ) 8 # now do plotting 9 mpl . contourf (x , y , B ) 10 mpl . colorbar () 11 mpl . show () Wesly Chun, Google IO 2011 What is Python?
  • 15. Web frameworks Django TurboGears, Pylons, repoze.bfg, Pyramid web2py web.py Google App’s Engine webapp Werkzeug, Flask, Tipfy Zope, Plone Tornado etc. ”Python: the only language with more web frameworks that keywords.” Harald Armin Massa, 2005 groups.google.com/group/comp.lang.python/msg Wesly Chun, Google IO 2011 What is Python?
  • 16. Python used for... Networking Web/RIA apps QA/testing, automation frameworks Text Processing Database Programming Scientific, mathematical/numeric processing Hardware/embedded system design Multimedia, graphics/imaging, animation GUI development Java, .NET, COM/MFC Batteries included Wesly Chun, Google IO 2011 What is Python?
  • 17. Python @ ??? Google Yahoo! Dropbox Disney, Pixar, Dreamworks Lucas: Lucasfilm, ILM, LucasArts VMware, Broadcom, QNX Evite, eventbrite, Justin.tv Yelp, Tripit, Zillow, Netflix Red Hat, Ubuntu/Canonical, OLPC, Raspberry Pi NASA, NOAA (NWS), NSA etc. Wesly Chun, Google IO 2011 What is Python?
  • 18. Python and Google An official language Can deploy to production servers C++ primary development language Need for systems/scripting language Java came later Wesly Chun, Google IO 2011 What is Python?
  • 19. History @ Google Use of Python before company founded ”In order to scale hundreds of millions of web pages, Google has a fast distributed crawling system. A single URLserver serves... URLs to a number of crawlers... Both the URLserver and the crawlers are implemented in Python.” From ”Anatomy of a Large-Scale Hypertextual Web Search Engine” S. Brin & L. Page, Stanford University, 1998 infolab.stanford.edu/ backrub/google.html Wesly Chun, Google IO 2011 What is Python?
  • 20. Another quote ”Python has been an important part of Google since the beginning, and remains so as the system grows and evolves.” – Peter Norvig, Director of Research at Google Wesly Chun, Google IO 2011 What is Python?
  • 21. Products using Python Google App Engine YouTube (flexibility, rapid development, simplicity) code.google.com Various open source libraries Wesly Chun, Google IO 2011 What is Python?
  • 22. Other uses of Python Build system System administration tools Monitoring, managing systems Log anaylsis Report generation Code review tool QA/testing Automation Extensive use of SWIG App Engine apps Wesly Chun, Google IO 2011 What is Python?
  • 23. Two versions of Python Python 2: current version Python 3: next generation Language evolving Backwards-incompatible Insert FUD here No community fragmentation Wesly Chun, Google IO 2011 What is Python?
  • 24. Hello World (again) Python 2.x 1 print ’ Hello World ! ’ Python 3.x 1 print ( ’ Hello World ! ’) Or use the standard file methods 1 import sys 2 sys . stdout . write ( ’ Hello World ! n ’) Wesly Chun, Google IO 2011 What is Python?
  • 25. Which to start with? Python 3.x: next generation Do this if completely new Python 2.x: current version Most books/tutorials still here Do this if have existing software Bottom-line: either is fine Wesly Chun, Google IO 2011 What is Python?
  • 26. That’s all folks Wesly Chun, Google IO 2011 What is Python?