lesson 1: quick introduction to the python language (www.python.org) 1) open up a terminal so you can type unix commands 2) type the command python you should see some text telling you what version it is, followed by the prompt ">>>" wehre you can type more (now python) commands: a=1 b=2 a+b and it will say: 3 (surprised?) or c=a+b print c print a,b,c print "Hello a=",a print "Hello a=%g b=%g c=%g" % (a,b,c) A=[1,2,3] B=[10,11,12] A+B Note that 'a' is different from 'A' for i in A print i Note the peculiar indentation you need to use, and only after the 3rd RETURN will it execute this 'for' loop 3) Many functions in python come from "modules" that need to be loaded. import math now you have some math help(math) math.sqrt(4) math.pi PTO: don't forget items 4) and 5) on the other side of this page.... 4) make a table with numbers in a file, with some editor like emacs, vi, Look at the file more table1 Count how many characters,lines and words wc table1 5) Now process the file in python file = open('table1','r') lines = file.readlines() file.close() lines it is len(lines) check if it's the same as "wc" gave sum = 0 for l in lines: sum = sum + float(l) print sum Type control-d to exit from python