Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.

Slides:



Advertisements
Similar presentations
Intro to Python Welcome to the Wonderful world of GIS programing!
Advertisements

Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
Python Henry Armstrong Andy Burras Everett Hite. History First released in 1991 by Guido van Rossum Designed around a philosophy which emphasized readability.
Reasons to study concepts of PL
ISBN Chapter 1 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Motivation Programming Domains.
Programming Languages Structure
Drew Murphy Drew Ebelhar. History December 18, 1987 Creator- Larry Wall Objective: To develop a general purpose Unix scripting language to make report.
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
Compilers and Interpreters. Translation to machine language Every high level language needs to be translated to machine code There are different ways.
ISBN Chapter 1 Topics Motivation Programming Domains Language Evaluation Criteria Influences on Language Design Language Categories Language.
The Basic Tools Presented by: Robert E., & Jonathan Chase.
Jonathan Huelman CSC 415 – Programming Languages
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Concepts of Programming Languages Chapter 1.
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Systems Software Operating Systems.
Python Introduction.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
CS 355 – Programming Languages
SB ScriptBasic Introduction to ScriptBasic There are more people writing programs in BASIC than the number of people capable programming.
Introduction to Programming Peggy Batchelor.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
The First Pune Python meet organized by PythonThreads.com The First Pune Python meet organized by PythonThreads.com What is it? Python is a Free, Open.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Python – May 11 Briefing Course overview Introduction to the language Lab.
Intro to Python Adriane Huber Debbie Bartlett Python Lab #1Python Lab #1 1.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Programming Domains 1.Scientific Applications Typically, scientific applications have simple data structures but require large numbers of floating-point.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Unit 1 Basic Python programs, functions Special thanks to Roy McElmurry, John Kurkowski, Scott Shawcroft, Ryan Tucker, Paul Beck for their work. Except.
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.
A Python Tour: Just a Brief Introduction "The only way to learn a new programming language is by writing programs in it." -- B. Kernighan and D. Ritchie.
Python 1 SIGCS 1 Intro to Python March 7, 2012 Presented by Pamela A Moore & Zenia C Bahorski 1.
Game programming 1.
The language focusses on ease of use
CST 1101 Problem Solving Using Computers
A Python Tour: Just a Brief Introduction
Before You Begin Nahla Abuel-ola /WIT.
Why study programming languages?
NOCTI Study Guide #2.
PROGRAMMING LANGUAGES
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
Pamela Moore & Zenia Bahorski
Programming Basics Web Programming.
Chapter 1 Reasons to study concepts of PLs Programming Domains
1.1 Reasons to study concepts of PLs
Chapter 1 Preliminaries.
Python Training in Chennai
SVTRAININGS. SVTRAININGS Python Overview  Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed.
1 Python Lab #1 Intro to Python Adriane Huber Debbie Bartlett.
Introduction to Python
basic Python programs, defining functions
(Computer fundamental Lab)
CSC 142 Introduction to Java [Reading: chapters 1 & 2]
Chapter 1: Programming Basics, Python History and Program Components
Reasons To Study Programming Languages
Lecture 2 Concepts of Programming Languages
Introduction to Computer Science
Python is a popular programming language. It was created by Guido van Rossum, and released in It is an interpreted, interactive, object-oriented.
Presentation transcript:

Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011

Background  Guido Van Rossum implemented/created Python in He wanted to create a language anyone can use. The point was to make it an easy language to learn.  Rossum is known as Python’s Principal Author   Python was awarded the TIOBE Programming Language of the Year twice (2007, 2010)

About Python  ‘Pythonistas’ (advocates of Python) believe that Python is better than C or C++ and should be used for all programming work, not just scripting  Uses dynamic typing with the feature of “late binding”  Uses reference counting and a cycle detecting garbage collector  Can be used as an extension language for existing modules and applications that need a programmable interface  Used on windows macintosh and unix platforms

Domain and Implementation  Often used as a scripting language for web applications although this was not its original purpose  Has been used in Artificial Intelligence (AI)  Can be used for CGI  Python was implemented in C  Implementations can compile not only byte codes but can turn Python code into machine code

Evaluation: Writability  Python’s Philosophy: “There should be one and preferably only one way to do it.”  Clean and clutter free syntax and in plain English  Multi-paradigm programming language so programmers can use different programming styles when writing (functional, object- oriented, imperative)  There are no semicolons at the end of Python source code statements. A new line means a new statement. If you need a very long line, you can use the backslash character for continuation, e.g. x = y + \ z

Evaluation: Readability  Python’s Goal: “To reduce confusion by having a syntax that is understandable in plain English”  Includes basic text  Includes basic text manipulation facilities of Awk and Perl, making it easier to read   Fewer syntax rules   Similar format for if/for/while statements as other programs   A+ for readability. This is considered one of its greatest advantages.

Evaluation: Reliability  Python is implemented in C and relies on well understood, portable C libraries  Python.org states that in applications that started out as pure C++ with Python being added as an extension language, a higher % of code written in Python = an increase in overall performance, functionality and reliability of the application.  Creates robust applications

Evaluation: Cost  Cost of interactivity is high but it speeds up the execution time  Because it is so easy to learn and write, the cost is lower in the training and development stages and interactive mode makes testing fast and easy. “When in doubt, try it out!”

Advantages  Easy to learn, even non experienced programmers can use it. Ex: spacing and tabbing instead of extra syntax (Don’t have to learn new rules)  Can be used extensively to benefit other programming languages  Interactive mode  Development process proceeds 5 to 10 times faster than in other languages such as Java or C++  Less memory used because a single container hold multiple data types and each type doesn’t require its own function

Disadvantages  Python interprets the code during runtime instead of compile time causing a slower execution. Runs 1 to 5 times slower than Java or C++  Official documentation is scarce because the language evolves so often.  New modules are not always a part of the standard release or standard library and must be imported into the project.

Fun Fact  Interactive mode allows Python to function as a quick calculator. Ex: What is 5% above 88.88? % python >>> 1.05*

Syntax Statements  If statement: if x < 3: print “hello”  For statement: for i in range(10): print i  While statement: while x < 8: x = x + 1

Program Example name = raw_input(‘Please enter your \ name:’) course = raw_input(‘Enter the course \ number:’) num = int(course) if num == 311: print name, “ is in this class.” else: print name, “ is not in this class.”

Who’s Using Python?  Google  Gaming industries  Battlefield 2 – score keeping and team balancing  Star Trek Bridge Commander – mission scripting and many other features  Yahoo Maps  Linux Weekly News

Sources  A Quick, Painless Tutorial on the Python Language by Norman Matloff  python.org and wiki.python.org  ugweb.cs.ualberta.ca