Python By Steve Wright. What is Python? Simple, powerful, GP scripting language Simple, powerful, GP scripting language Object oriented Object oriented.

Slides:



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

Hash Tables Many of the slides are from Prof. Plaisteds resources at University of North Carolina at Chapel Hill.
Comp 122, Spring 2004 Hash Tables – 1. hashtables - 2 Lin / Devi Comp 122, Fall 2003 Dictionary Dictionary: »Dynamic-set data structure for storing items.
Symbol Table.
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.
Python Hyunjong Lee. contents  Introduction  Syntax & data types  Tools  Python as CGI.
A Crash Course Python. Python? Isn’t that a snake? Yes, but it is also a...
What is a scripting language? What is Python?
‘And Now For Something Completely Different’ Python Programming David Hartwell Clements.
Python: a modern hybrid A language for scripting and prototyping Balance between extensibility and powerful built-in data structures genealogy: –Setl (NYU,
Introduction to Python Programming Languages Fall 2002 Adapted from Tutorial by Mark Hammond Skippi-Net, Melbourne, Australia
Scripting languages Typically a language used for short programs to manage other programs. Interpreted, dynamically typed, permissive semantics Usually.
Python Brandon Jeffcoat Dashaun West “Why settle for snake oil when you can have the whole snake?” -- From Usenet posting by Mark Jackson, June 1998.
Introduction to Python. Outline Python IS ……. History Installation Data Structures Flow of Control Functions Modules References.
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
Scripting Languages CS351 – Programming Paradigms.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Python Introduction.
CSE 380 – Computer Game Programming Scripting and Lua Lua.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved.
Introduction to Python Guido van Rossum Director of PythonLabs at Zope Corporation
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
1 Perl Perl basics Perl Elements Arrays and Hashes Control statements Operators OOP in Perl.
Data Structures in Python By: Christopher Todd. Lists in Python A list is a group of comma-separated values between square brackets. A list is a group.
Computer Science 111 Fundamentals of Programming I Overview of Programming.
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
1 Python CIS*2450 Advanced Programming Concepts Material for this lecture was developed by Dr. D. Calvert.
The Python Programming Language Jeff Myers Programming Language Concepts, 01/14/2002
Chapter 4 Numbers. Python Program Structure Python programs consist of: Modules Statements Expressions Objects.
H3D API Training  Part 3.1: Python – Quick overview.
Introduction to Python September 26, /10/ Bioinformatics Languages Low-level, compiled languages: C, C++, Java… Pros: performance Cons:
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
A very basic overview of Server-Side Scripting Or what is PHP, Perl, Python, Ruby and what can they do for me?
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Python. By Jawad. What Is Python? Python is an open-source object-orientated scripting language. Python is good for embedding snippets to run a program.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Perl Language Yize Chen CS354. History Perl was designed by Larry Wall in 1987 as a text processing language Perl has revised several times and becomes.
Getting Started with Python: Constructs and Pitfalls Sean Deitz Advanced Programming Seminar September 13, 2013.
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Python. History of python  Python was conceived in the late 1980s and its implementation was started in December 1989 by Guido van Rossum at CWI in the.
Python I Some material adapted from Upenn cmpe391 slides and other sources.
Introduction to Python Origins Nature of Python Importance of Python Example.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
By Austin Laudenslager AN INTRODUCTION TO PYTHON.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Array Lists Array Lists Dale.
Guide to Programming with Python Chapter Five Lists and dictionaries (data structure); The Hangman Game.
 History  Ease of use  Portability  Standard  Security & Privacy  User support  Application &Popularity Today  Ten Most Popular Programming Languages.
Python Dr. Maury Eggen Fall Introduction #!/usr/bin/python python is interpreted python is not strongly typed python allows multiple assignments.
12. MODULES Rocky K. C. Chang November 6, 2015 (Based on from Charles Dierbach. Introduction to Computer Science Using Python and William F. Punch and.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Euphoria Programming Language CSC 507 Kasilingam Vimalan.
PYTHON PROGRAMMING. WHAT IS PYTHON?  Python is a high-level language.  Interpreted  Object oriented (use of classes and objects)  Standard library.
Python Joseph Eckstrom, Benjamin Moore, Willis Kornegay.
What Do Computers Do? A computer system is
Python Programming Unit -1.
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during.
Henning Schulzrinne Advanced Programming
Introduction to Python
What to do today: Brief history of Ruby General qualities/info
Introduction to Python
Introduction to Python
Data Model.
(more) Python.
Chapter 1: Programming Basics, Python History and Program Components
Introduction to Python
Python Basics. Topics Features How does Python work Basic Features I/O in Python Operators Control Statements Function/Scope of variables OOP Concepts.
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Python By Steve Wright

What is Python? Simple, powerful, GP scripting language Simple, powerful, GP scripting language Object oriented Object oriented Interpreted Interpreted Procedural Procedural Open source Open source Interactive Interactive Dynamic typing Dynamic typing Garbage collection Garbage collection

Brief History Written by Guido van Rossum; Dec Written by Guido van Rossum; Dec Descendant of ABC Descendant of ABC Used for system administration (Amoeba) Used for system administration (Amoeba) Appeal to UNIX/C developers Appeal to UNIX/C developers Python Software Activity (PSA) Python Software Activity (PSA)

Basic structure 1. Programs are composed of modules 2. Modules contain statements 3. Statements create and process objects Modules can be imported and used in interactive mode (like Scheme) Modules can be imported and used in interactive mode (like Scheme) Uses indentation to create blocks and scope Uses indentation to create blocks and scope

Basic Types Numbers – ints, long ints (unlimited size), floating-point, octal/hex, complex Numbers – ints, long ints (unlimited size), floating-point, octal/hex, complex Operators: +, -, /, *, >>, **, etc. Operators: +, -, /, *, >>, **, etc. Strings – ordered collection of characters Strings – ordered collection of characters Operators: +, *, [i:j], len, for x in y, etc. Operators: +, *, [i:j], len, for x in y, etc. Lists – ordered collection of objects Lists – ordered collection of objects Operators: similar to String operators Operators: similar to String operators Dictionaries – hash tables Dictionaries – hash tables Operators: has_key, keys, values, len, etc. Operators: has_key, keys, values, len, etc.

List sample L = [0, 1, 2] create a list of 3 items L = [0, 1, 2] create a list of 3 items L.append(-3) add element to end L.append(-3) add element to end L.insert(3, 50) insert 50 at index 3 L.insert(3, 50) insert 50 at index 3 L.sort() sort the list L.sort() sort the list del L[4:5] delete a slice of list del L[4:5] delete a slice of list L.reverse() reverse the list L.reverse() reverse the list

Program example items = [“aaa”, 111, (4, 5), 2.01] tests = [(4, 5), 3.14]# items to search for for key in tests: if key in items: if key in items: print key, “was found” else: else: print key, “not found” (4, 5) was found 3.14 not found

Advantages Dynamic typing – doesn’t require complicated type and size declarations Dynamic typing – doesn’t require complicated type and size declarations Built-in objects and tools to use them Built-in objects and tools to use them Vast library utilities – system, networking, regular expressions, etc. Vast library utilities – system, networking, regular expressions, etc. Automatic memory management Automatic memory management Comes with standard GUI API (Tkinter) Comes with standard GUI API (Tkinter) Rapid prototype tool for C programs Rapid prototype tool for C programs Simple, easy to read/learn, and it’s free! Simple, easy to read/learn, and it’s free!

Disadvantages Slower and less efficient than static, compiled languages like C Slower and less efficient than static, compiled languages like C Device drivers and other OS kernal programs are not suitable for Python because of it’s dynamic memory allocation Device drivers and other OS kernal programs are not suitable for Python because of it’s dynamic memory allocation