Lec-04-BWN - 9/13/2009 Lecture 04 Introduction to Python...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
9/13/2009 1 ECE 364: Software Tools Laboratory Lecture 4 February 2, 2009 1 © 2007 Jeff Turkstra, Sam Midkiff, and Fred Mowle Lecture 04 Introduction to Python 2 Textbooks The Quick Python Book by Daryl Harms and Kenneth McDonald, Manning, 2000 ISBN 1-884777-74-0 Python Essential Reference by David Python Essential Reference by David Beazley, New Riders, 1999 ISBN 0-7357-0901-7 3 Sample programs Copies of the programs covered in this class can be found in the following directory: /home/elwomnt/a/ee364/LEC-XX (or, ~ee364/LEC-XX) where XX is the lecture number. ~ee364/LEC-04 for instance 4 What is Python? An interpreted language (byte-code compiled) An interactive language A procedural, object oriented, and functional language Python has a very clear syntax that intentionally looks like pseudo-code Selected features: High level dynamic data types Dynamic typing A huge standard library Lots of third-party modules Can easily write C/C++ extensions 5 Where is Python found today? Games: EVE Online Civilization IV Disney’s Panda3D engine Internet Django Zope Google Entertainment: Industrial Light and Magic YouTube Research/Science/Engineering: NASA CERN 6
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
9/13/2009 2 Syntax and features No braces { } Indentation is used as a delimiter Forces some level of readability No semicolons on ends of statements unless needed to separate multiple statements on one line No $ preceding variable names 7 Interactive mode Interactive python: Useful for testing out things you're not sure about Useful for prototyping algorithms Invoke at the command line with: python ipython idle (graphical version) Comes with a built in help function: >>> help(list) >>> import sys >>> help(sys) 8 The traceback When Python crashes, you will see a message like this: Traceback (most recent call last): File "./tables.py", line 12, in <module> x_start = float(sys.argv[3]) ValueError: invalid literal for float(): c Read it carefully, starting from the bottom and working backwards.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/01/2009 for the course PSY 120 taught by Professor Donnely during the Spring '08 term at Purdue University-West Lafayette.

Page1 / 6

Lec-04-BWN - 9/13/2009 Lecture 04 Introduction to Python...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online