2. What is Python?
Easy to learn
Simple syntax
Dynamic typing
High-level data structures Free
Linux/Unix, OS X, Windows
MIT’s language of choice
3. Why Python?
Fast development cycle
Interactive & edit, debug/run
vs. edit, compile, debug/run
Extensive standard and add-on libraries
(MIT’s language of choice)
Python, Jython, & IronPython
Google AppEngine
4. Basic Syntax
Block structured
But no braces
Indent defines blocks
def fib(n):
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
9. Memento & Timemap for
www.cs.odu.edu
http://api.wayback.archive.org/memento/timemap/link/http://www.cs.odu.edu
1. <http://www.cs.odu.edu>; rel="original",
2. <http://api.wayback.archive.org/list/timemap/link/http://www.cs.odu.edu>;
rel="timemap"; type="application/link-format”,
3. <http://api.wayback.archive.org/memento/19970102130137/http://cs.odu.edu/>;
rel="first memento"; datetime="Thu, 02 Jan 1997 13:01:37 GMT”,
4. <http://api.wayback.archive.org/memento/19970606105039/http://www.cs.odu.edu/
>; rel="memento"; datetime="Fri, 06 Jun 1997 10:50:39 GMT",
Output from timemap.py test
1. Original: http://www.cs.odu.edu
2. Time Map:
http://api.wayback.archive.org/list/timemap/link/http://www.cs.odu.edu
3. First Memento:
(datetime.datetime(1997, 1, 2, 13, 1, 37, tzinfo=tzutc()), 'http://api.wayback.archive.o
rg/memento/19970102130137/http://cs.odu.edu/')
4. 1997-06-06 10:50:39+00:00 =
http://api.wayback.archive.org/memento/19970606105039/http://www.cs.odu.edu/
10. timemap.py Output
Original: http://www.cs.odu.edu
Time Bundle: http://api.wayback.archive.org/list/timebundle/
http://www.cs.odu.edu
Time Gate: http://api.wayback.archive.org/list/timegate/
http://www.cs.odu.edu
Time Map: http://api.wayback.archive.org/list/timemap/link/
http://www.cs.odu.edu
First Memento: 1997-01-02 13:01:37+00:00
Last Memento: 2011-07-20 01:58:31+00:00
Mementos:
1997-06-06 10:50:39+00:00 = http://api.wayback.archive.org/memento/
19970606105039/http://www.cs.odu.edu/
1997-10-10 20:16:32+00:00 = http://api.wayback.archive.org/memento/
19971010201632/http://www.cs.odu.edu/
11. Code Walk Through
class TimeMap: Memento timemap container class
class TimeMapTokenizer: Helper class to tokenize a link-style
timemap
__main__: Used for quick unit testing
Download the code:
http://www.cs.odu.edu/~sainswor/uploads/Downloads/timemap.py
12. Summary
Easy to learn Fast development cycle
Dynamic typing Extensive standard and
add-on libraries
High-level data structures
Widely-supported
Free
Linux/Unix, OS X, Windows