Python www.python.org. Whats in a name? Snake logos and mascot notwithstanding, its named after Monty Pythons Flying Circus Humor-impaired can safely.

Slides:



Advertisements
Similar presentations
Perl Practical Extration and Reporting Language An Introduction by Shwen Ho.
Advertisements

A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
director of PythonLabs at Zope Corporation
Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
10/09/1999© 1999 CNRI, Guido van Rossum 1 Computer Programming for Everybody Guido van Rossum CNRI (Corporation for National Research Initiatives, Reston,
10/10/1999© 1999 CNRI, Guido van Rossum 1 Python Workshop Guido van Rossum CNRI (Corporation for National Research Initiatives, Reston, Virginia,
EIONET Training Beginners Zope Course Miruna Bădescu Finsiel Romania Copenhagen, 27 October 2003.
In Review JAVA C++ GUIs - Windows Webopedia.com.
How to enter the world of Python Programming for ArcGIS Or, a funny thing happened on the way from an ESRI conference By Katherine Paybins WVAGP Membership.
Introduction to Python Week 15. Try It Out! Download Python from Any version will do for this class – By and large they are all mutually.
A Crash Course Python. Python? Isn’t that a snake? Yes, but it is also a...
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Python By Steve Wright. What is Python? Simple, powerful, GP scripting language Simple, powerful, GP scripting language Object oriented Object oriented.
Ruby The Gem of new programming languages. An interpreted scripting language.
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
1 Outline 7.1 Introduction 7.2 Implementing a Time Abstract Data Type with a Class 7.3 Special Attributes 7.4Controlling Access to Attributes 7.4.1Get.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Python Introduction.
Ch 1. Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
GlueTrack interpreter for S2E beam dynamic simulations Igor Zagorodnov BDGM, DESY
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)

28 May, 1999Le Copyright © 1999 CNRI, Guido van Rossum 1 Le Python à Paris Guido van Rossum CNRI (Corporation for National Research Initiatives, Reston,
Python Guido van Rossum Sung-Jin Hong SPARCS
1 Python CIS*2450 Advanced Programming Concepts Material for this lecture was developed by Dr. D. Calvert.
Programming language A programming language is an artificial language designed to communicate instructions to a machine,languageinstructionsmachine particularly.
Ruby! Ronald L. Ramos. What is Ruby? Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms,
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Eagle: Maturation and Evolution 17th Annual Tcl Conference Joe Mistachkin.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Intro to Python Programming (Part 1) Pamela Moore Zenia Bahorski Eastern Michigan University March 16, 2011 A language to swear by, not at.
CS105 Computer Programming PYTHON (based on CS 11 Python track: lecture 1, CALTECH)
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
TCL TK. Tcl/Tk C functions can become Tcl commands that are invoked interactively Tk = scriptable, portable user interface –Windows, X (Unix), MacOS,
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 13 A & B Programming Languages and the.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Bucharest, 23 February 2005 CHM PTK technologies Adriana Baciu Finsiel Romania.
First appeared Features Popular uses Basic This language emphasises on ease of use, allowing general purpose programming to those with a small amount of.
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Zope Concepts - Python scripts Valentin Baciu Finsiel Romania Tirana, 6 June 2005.
Applications Active Web Documents Active Web Documents.
Python Programming Unit -1.
CST 1101 Problem Solving Using Computers
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Scope History of Ruby. Where can you use Ruby? General Features.
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
Introduction to.
Ch 1. A Python Q&A Session Bernard Chen 2007.
Programming Language Concepts (CIS 635)
Perl Modules.
SVTRAININGS. SVTRAININGS Python Overview  Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed.
How to enter the world of Python Programming for ArcGIS
Introduction to Python
Introduction to Python
FEATURES OF PYTHON.
Web Application Development Using PHP
Presentation transcript:

Python

Whats in a name? Snake logos and mascot notwithstanding, its named after Monty Pythons Flying Circus Humor-impaired can safely ignore the spam references :-) Nobody expects the Spanish inquisition

What is Python? O-O rapid prototyping language Not just a scripting language Not just another Perl-wannabe Extensible (add new modules) –C/C++/Fortran/whatever –Java (through JPython) Embeddable in applications

Touchy-feely properties Free (open source) –copyrighted but use not restricted Mature (9 years old) Supportive user community –& more books in the pipeline! Elegant design, easy to learn –reads like pseudo-code –Suitable as first language

High-level properties Extremely portable –Unix, Windows, Mac, BeOS, Win/CE, DOS, OS/2, Amiga, VMS, Cray, … Compiles to interpreted byte code –compilation is implicit and automatic Memory mgt through ref counting –easier for C/C++ extensions Safe: no core dumps

Interfaces to... COM, DCOM, ODBC Commercial databases Java (JPython) Many GUI libraries –platform-independent Tk, wxWindows, GTK –platform-specific MFC, MacOS, X11

Language properties Everything is an object Modules, classes, functions Exception handling Dynamic typing, polymorphism Static scoping Operator overloading Indentation for block structure –Otherwise conventional syntax

High-level data types Numbers: int, long, float, complex Strings: immutable Lists and dictionaries: containers Other types for e.g. binary data, regular expressions, introspection Extension modules can define new built-in data types

What is it used for? rapid prototyping web scripting throw-away, ad hoc programming steering scientific applications extension language XML processing database applications GUI applications

Who is using it? LLNL, Fermilab (steering) Alice project at CMU (3D graphics) ObjectDomain (extend UML tool) Infoseek (ext. language, scripting) Industrial Light & Magic (everything) Yahoo! (CGI in Yahoo!mail) Digital Creations (Zope website mgt) RedHat (Linux installation tools)

Compared to Perl Easier to learn –especially for infrequent users More readable code –improved code maintenance Fewer magical side effects More safety guarantees Better Java integration Some things slower

Compared to Java Code 5-10 times more concise Dynamic typing Much quicker development –no compilation phase –less typing Yes, it runs slower –but development is much faster! Ditto (but more so) for C/C++

Compared to Tcl Real datatypes, object-orientation More differentiated syntax Much faster (even than Tcl 8.0) Can use threads Less need for C extensions –hence fewer extension conflicts Better Java integration Python uses Tk as de-facto GUI std

JPython Seamless integration with Java Separate implementation –classic Python called CPython here Implements the same language Different set of standard modules differences in gray areas –e.g. some different introspection calls –different command line options, etc.

Java integration Interactive Compiles direct to Java bytecode Import Java classes directly Subclass Java classes –pass instances back to Java Java beans integration Can compile into Java class files –run as applet in browsers

Example function def gcd(a, b): greatest common divisor while a != 0: a, b = b%a, a # parallel assignment return b

Example class class Stack: A well-known data structure… # doc string def __init__(self): # constructor self.items = [] def push(self, x): self.items.append(x) # the sky is the limit def pop(self): x = self.items[-1] # what happens if its empty? del self.items[-1] return x def empty(self): return len(self.items) == 0