Python222222222222222222222222222(2).ppt

DoudaSamih 6 views 19 slides Sep 21, 2024
Slide 1
Slide 1 of 19
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19

About This Presentation

eee


Slide Content

PYTHON

Mitch Martin

Josh Amick

Abdulla Al-nuaimi

Brad Gunnells

Points of Interest

Overview

Language evolution

Language concepts

Examples of usage

Comparison and Popularity

Impact and Assessment

What is Python?

Interpreted, Interactive and Object-oriented

Remarkable power with clear syntax

Interfaces to system calls and libraries

Extensible in C or C++

Portable (Unix, Mac, MS-DOS, Windows, OS/2)

Incorporates: modules, exceptions, dynamic
typing, very high level dynamic data types, and
classes

Python name?

Looking for name that was short,
unique, and slightly mysterious

Guido van Rossum was reading
“Monty Python ’s Flying Circus” at the
time

Decided to call new language
PYTHON

History

Created by Guido van Rossum

Started during Christmas holidays
1989

Spent year working on own time

Success using it in Amoeba Project

Prompted him to keep improving it

Problem Domain

Guido van Rossum needed a scripting
language like ABC that could access
Amoeba system calls.

He also realized it would need to be
extensible so it wouldn’t be specific to
the Amoeba Project.

Problem Domain cont.

ABC

Use of indentation for statement
grouping

Very-high-level data types

Implementation very different

Lack of extensibility led to:


Had experience with Modula-2+

Talked to designers of Modula-3

Read Modula-3 report

Origin of syntax and semantics
used for exception handling
Problem Domain cont.

Language Concepts

Dynamically Typed

No need for type declarations before use

Clean and Concise Syntax

No Braces or semicolons

Indentations define blocks ->

No Switch Statement

Use if...elif...elif...else

One Constructor per Class
Example:
if x == y:
...block
elif x > y:
...block
else:
...block

Sample Code
class Student():
def __init__(self, argStudentName, argGPA = 0, argClass = "freshman"):
self.StudentName = argStudentName
self.GPA = argGPA
self.Class = argClass
...

Sample Code

Sample Code (cont.)

Python Compared to Other
Languages

Scripting language

High-Level
language

Syntax

Emphasizes
readability

Indentation

If, while, for
http://en.wikipedia.org/wiki/
Image:Python_add5_syntax.png

Comparison con't.

Free under GNU GPL

Object oriented

Very similar to Perl, Ruby, Scheme, Smalltalk &
Tcl

Can work with other languages such as Java and
C/C++

Types – Variables

Duck – Latent typing

Does not enforce static typing

Strongly typed

Python Popularity

Relatively young
language – Created
in early 1990's

Tens of thousands
of users

NASA, AstraZeneca
and Honeywell,
Industrial Light and
Magic, Google,
Yahoo
http://www.python.org/pics/pythonHi.gif

Usage

It can handle small and big projects.

Actively used in industry and academia.

It utilizes some of the largest projects
Such as:

Zope: application server

BitTorrent: file sharing

Google: used extensively

Future development
Python 3.0 (Python 3000)
New features:

moving map, filter and reduce out of the built-in namespace.

adding support for optional type declarations.

unifying the str/unicode types, and introducing a separate
mutable bytes type.

converting built-ins to returning iterators (instead of lists),
where appropriate.

removing backward-compatibility features like classic
classes, classic division, string exceptions, and implicit
relative imports.

Questions
Questions are guaranteed in life;
Answers aren’t
????

Bibliography
http://www.python.org/doc/faq/general/

http://en.wikipedia.org/wiki/Python_
programming_language

http://www.ibiblio.org/g2swap/
byteofpython/read/if-statement.html
Tags