Cmpe202 01 Research

718 views
665 views

Published on

CMPE202-01 Research project. SJSU 2011

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
718
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Python 2.0 was released on 16 October 2000, with many major new features including a full garbage collector and support for Unicode.
  • Cmpe202 01 Research

    1. 1. Programming Language Overview Copyright ©2011, Volodymyr Korshak
    2. 2. Outline <ul><li>History review. Why and by whom was python created? </li></ul><ul><li>Programming philosophy. How is it different to any other language? </li></ul><ul><li>Code samples. &quot;Hands on&quot; experience. </li></ul><ul><li>Usage and Possibilities. </li></ul>
    3. 3. History in Brief
    4. 4. History overview <ul><li>Python was conceived in the late 1980s by Guido van Rossum as a successor to the ABC programming language capable of exception handling. </li></ul><ul><li>Python has twice been awarded as TIOBE Programming Language of the Year (2007, 2010), which is given to the language with the greatest growth in popularity over the course of the year (as measured by the TIOBE index). </li></ul>
    5. 5. Programming Philosophy
    6. 6. Programming philosophy <ul><li>Python uses dynamic typing and a combination of reference counting and a cycle-detecting garbage collector for memory management. </li></ul><ul><li>Pseudo-code: </li></ul>
    7. 7. Programming philosophy <ul><li>An important feature of Python is dynamic name resolution (late binding), which binds method and variable names during program execution. </li></ul><ul><li>Pseudo-code: </li></ul>
    8. 8. Programming philosophy <ul><li>Designed to be highly extensible. New built-in modules can be easily written in C, C++ or Cython. </li></ul><ul><li>Most of widely used modules are included in the Standard Library. </li></ul><ul><li>&quot;there should be one—and preferably only one—obvious way to do it&quot; </li></ul><ul><li>Code should be &quot;beautiful&quot;, &quot;explicit&quot; &quot;simple&quot; and “easily-readable” </li></ul>
    9. 9. Most famous modules <ul><li>PyGame - Principal wrapper of the SDL library. </li></ul><ul><li>PyQt - Bindings for the cross-platform Qt framework. </li></ul><ul><li>Python Imaging Library (PIL) - Supports many file formats, and provides powerful image processing and graphics capabilities. </li></ul><ul><li>Django - High-level web framework. </li></ul><ul><li>web2py - High-level framework for agile development. </li></ul><ul><li>And many, many other powerful libraries, frameworks and modules. </li></ul>
    10. 10. Code Samples
    11. 11. Code Samples: Layout <ul><li>Python does not use { } to enclose blocks of code for if/loops/function etc.. Instead, Python uses the colon (:) and indentation/whitespace to group statements. </li></ul>
    12. 12. Code Samples: Slices <ul><li>The &quot;slice&quot; syntax is a handy way to refer to sub-parts of sequences - typically strings and lists. The slice s[start:end] is the elements beginning at start and extending up to but not including end. </li></ul>
    13. 13. Code Samples: Lists <ul><li>Python has a great built-in list type named &quot;list&quot;. List literals are written within square brackets [ ]. </li></ul>
    14. 14. Code Samples: For In <ul><li>Python's “for” and “in” constructs are extremely useful, and the first use of them we'll see is with lists. The “for” construct - for var in list - is an easy way to look at each element in a list (or other collection). </li></ul>
    15. 15. Code Samples: List Methods <ul><li>Common list methods: </li></ul>
    16. 16. Code Samples: Dicts <ul><li>Python's efficient key/value hash table structure is called a &quot;dict&quot;. The contents of a dict can be written as a series of key:value pairs within braces { } </li></ul>
    17. 17. Code Samples: Dicts <ul><li>Common “dict” methods: </li></ul>
    18. 18. Where is it used?
    19. 19. Common Usage <ul><li>Often used as a scripting language. </li></ul><ul><li>In operating systems. </li></ul><ul><li>In large companies and organizations. </li></ul>
    20. 20. Common Usage <ul><li>Often used as a scripting language: </li></ul><ul><li>Python has been successfully embedded in a number of software products as a scripting language, including in finite element method software such as Abaqus, 3D animation packages such as Houdini, Maya, MotionBuilder, Softimage, Cinema 4D, BodyPaint 3D, modo and Blender and 2D imaging programs like GIMP, Inkscape, Scribus and Paint Shop Pro. </li></ul>
    21. 21. Common Usage <ul><li>In operating systems: </li></ul><ul><li>It ships with most Linux distributions, NetBSD, OpenBSD and with Mac OS X and can be used from the terminal. A number of Linux distributions use installers written in Python: Ubuntu uses the Ubiquity installer, while Red Hat Linux and Fedora use the Anaconda installer. Gentoo Linux uses Python in its package management system, Portage and the standard tool to access it, emerge. Pardus uses it for administration and during system boot. </li></ul>
    22. 22. Common Usage <ul><li>In large companies and organizations: </li></ul><ul><li>Among the users of Python are YouTube and the original BitTorrent client. Organizations that make use of Python include Google, Yahoo!, CERN, NASA, ILM, and ITA. Most of the Sugar software for the One Laptop per Child XO, now developed at Sugar Labs, is written in Python. </li></ul>
    23. 23. Features
    24. 24. Features: Speed and Power <ul><li>Python is powerful... and fast: </li></ul><ul><li>Fans of Python use the phrase &quot;batteries included&quot; to describe the standard library, which covers everything from asynchronous processing to zip files. The language itself is a flexible powerhouse that can handle practically any problem domain. </li></ul>
    25. 25. Features: Easy and Open <ul><li>Python is friendly... and easy to learn: </li></ul><ul><li>Python also comes with complete documentation, both integrated into the language and as separate web pages. Online tutorials target both the seasoned programmer and the newcomer. All are designed to make you productive quickly. The availability of first-rate books completes the learning package. </li></ul><ul><li>Python is Open: </li></ul><ul><li>The Python implementation is under an open source license that makes it freely usable and distributable, even for commercial use. </li></ul>
    26. 26. Features: Flexible <ul><li>Python plays well with others: </li></ul><ul><li>For Java libraries, use Jython, an implementation of Python for the Java Virtual Machine. </li></ul><ul><li>For .NET, try IronPython , Microsoft's new implementation of Python for .NET. </li></ul><ul><li>If you find something that Python cannot do, or if you need the performance advantage of low-level code, you can write extension modules in C or C++, or wrap existing code with SWIG or Boost.Python. You can also go the opposite route and embed Python in your own application, providing your users with a language they'll enjoy using. </li></ul>
    27. 27. Features: Portable <ul><li>Python runs everywhere: </li></ul><ul><li>Python is available for all major operating systems: Windows, Linux/Unix, OS/2, Mac, Amiga, among others. There are even versions that run on .NET, the Java virtual machine, and Nokia Series 60 cell phones. You'll be pleased to know that the same source code will run unchanged across all implementations. </li></ul>
    28. 28. Summary
    29. 29. Summary <ul><li>Python has: </li></ul><ul><ul><li>very clear, readable syntax </li></ul></ul><ul><ul><li>intuitive object orientation </li></ul></ul><ul><ul><li>full modularity, supporting hierarchical packages </li></ul></ul><ul><ul><li>exception-based error handling </li></ul></ul><ul><ul><li>very high level dynamic data types </li></ul></ul><ul><ul><li>extensive standard libraries and third party modules for virtually every task </li></ul></ul><ul><ul><li>embeddable within applications as a scripting interface </li></ul></ul>
    30. 30. Credits <ul><li>Materials used: </li></ul><ul><ul><li>Official web-site: http://www.python.org </li></ul></ul><ul><ul><li>Google-python-class: http://code.google.com/edu/ </li></ul></ul><ul><ul><li>Wikipedia Python article: http://en.wikipedia.org/wiki/Python_(programming_language ) </li></ul></ul><ul><li>Copyright ©2011, Volodymyr Korshak </li></ul>

    ×