James Denton - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

James Denton

Description:

... programmed in a lower level language like C, which Python than interfaces with ... Easy to learn interpreted scripting language ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 12
Provided by: letu
Category:

less

Transcript and Presenter's Notes

Title: James Denton


1
  • James Denton
  • COSC 4153
  • Spring 2008
  • Assignment 11

2
Overview
  • History
  • Syntax and Semantics
  • Example Code
  • Use of the Language in Industry
  • Advantages and Disadvantages
  • Likes and Dislikes

3
Brief History
  • Created by Gudio van Rossum in 1991
  • Initially borrowed ideas from Modula-3 and LISP
  • Supported lambda calculus, map, filter, and
    reduce, among other things.
  • Python 2.0 list comprehensions and garbage
    collection
  • Python 2.2 unified types (Object oriented)?
  • Python 3.0 will address design flaws, reduce
    feature duplication, and break backwards
    compatibility

4
Basic Syntax and Semantics
  • Indentation used to mark statement blocks.
  • for loop cycles through lists, not numbers. (for
    item in list)?
  • if true
  • do this
  • def used to declare functions

5
Example Source Code
  • Boring Hello World example.
  • print I'm not dead yet!
  • More interesting example.
  • gtgtgt for row in range(1, 11)
  • ... for col in range(1, 11)
  • ... print "3d " (row col),
  • ... print
  • 1 2 3 4 5 6 7 8 9 10
  • 2 4 6 8 10 12 14 16 18 20
  • 3 6 9 12 15 18 21 24 27 30
  • 4 8 12 16 20 24 28 32 36 40
  • 5 10 15 20 25 30 35 40 45 50
  • 6 12 18 24 30 36 42 48 54 60
  • 7 14 21 28 35 42 49 56 63 70
  • 8 16 24 32 40 48 56 64 72 80
  • 9 18 27 36 45 54 63 72 81 90
  • 10 20 30 40 50 60 70 80 90 100

6
More code
  • gtgtgt breakfast "spam,spam,eggs,spam,and ham"
  • gtgtgt order ""
  • gtgtgt for item in breakfast.split(',')
  • ... if item "spam"
  • ... order (item " ") 3
  • ... else
  • ... order item " "
  • ... print b
  • Output
  • spam spam spam
  • spam spam spam spam spam spam
  • spam spam spam spam spam spam eggs
  • spam spam spam spam spam spam eggs spam spam spam
  • spam spam spam spam spam spam eggs spam spam spam
    and ham

7
Use of the Language in Industry
  • As Glue
  • Industrial Light and Magic
  • Glues together several separate rendering tools.
  • Used for plugins and extensions for rendering
    tools.
  • Rapid development
  • NASA - Used in custom workflow automation
    software.
  • YouTube
  • First BitTorrent client
  • Amazing string manipulation support
  • Google

8
Advantages and Disadvantages
  • Advantages
  • Scales well
  • Exceptions with safe error checking
  • Dynamic typing
  • Handles strings extremely well
  • Pseudocode-like syntax - very readable and clean
  • Fast prototyping
  • Interfacing with C is easy
  • Python has been ported to everything
  • Easily interfaces with C code and libraries
  • Disadvantages
  • It's interpreted
  • Closed source Python program? What's that?
  • Can easily be decompiled. Only reliable way is to
    run as a server-side application.
  • Performance
  • Slow algorithms are typically programmed in a
    lower level language like C, which Python than
    interfaces with

9
Likes and Dislikes
  • Likes
  • Excellent first language
  • It supports several different paradigms
  • object oriented and structured fully supported
  • Also possible to use as a functional or
    aspect-oriented language
  • Tons of libraries
  • Dislikes
  • One true way to code The Right Way
  • Error your tab hath not enough spaces
  • Can't really compile your code into a stand-alone
    binary like in C.
  • The type system is great, but confused me at
    first.

10
Conclusion
  • Easy to learn interpreted scripting language
  • Good for interfacing with other languages,
    prototyping things quickly, and working with
    strings.
  • Strongly typed, but does not enforce static
    typing.
  • It turned me into a newt!
  • I got better.

11
Bibliography
  • IBM Developer Works
  • http//www.ibm.com/developerworks/opensource/libra
    ry/os-python6/
  • Wikipedia
  • http//en.wikipedia.org/wiki/Python_(programming_l
    anguage
  • Python.org
  • http//www.python.org/
  • Using Linux in the real world python server
  • http//www.luv.asn.au/overheads/realworld/server.h
    tml
  • A Gentle Introduction To Python
  • http//spinning-yarns.org/michael/misc/python-intr
    o.pdf
Write a Comment
User Comments (0)
About PowerShow.com