# day 3 interactive IDLE log 
# (see also source files in ZIP archive for programs run here)

 
>>> 
>>> ================================ RESTART ================================
>>> 
Bob Smith Sue Jones 100000
>>> 
>>> name = 'Bob Smith'
>>> name.split()
['Bob', 'Smith']
>>> name.split()[-1]
'Smith'
>>> ================================ RESTART ================================
>>> 
Bob Smith Sue Jones 100000
Smith
110000.0
>>> ================================ RESTART ================================
>>> 
Bob Smith Sue Jones 100000
Smith Jones
110000.0
>>> ================================ RESTART ================================
>>> 
Bob Smith Sue Jones 100000
Smith Jones
110000.0
<__main__.Person instance at 0x0000000002844688>
>>> ================================ RESTART ================================
>>> 
[Person: Bob Smith, 0]
[Person: Sue Jones, 100000]
Smith Jones
[Person: Sue Jones, 110000.0]
>>> ================================ RESTART ================================
>>> 
[Person: Bob Smith, 0]
[Person: Sue Jones, 100000]
Smith Jones
[Person: Sue Jones, 110000.0]
[Person: Tom Jones, 120000.0]
>>> ================================ RESTART ================================
>>> 
>>> import glob
>>> glob.glob('scotts*')
[]
>>> glob.glob('scott*')
['scottdb']
>>> 
>>> import shelve
>>> db = shelve.open('scottdb')
>>> len(db)
3
>>> db.keys()
['tom', 'bob', 'sue']
>>> bob = db['bob']
>>> bob.name
'Bob Smith'
>>> bob.lastName()
'Smith'
>>> print bob
[Person: Bob Smith, 0]
>>> 
>>> for key in db:
	print key, '=', db[key]

	
tom = [Person: Tom Jones, 100000]
bob = [Person: Bob Smith, 0]
sue = [Person: Sue Jones, 100000]
>>> ================================ RESTART ================================
>>> 
tom = [Person: Tom Jones, 100000]
bob = [Person: Bob Smith, 0]
sue = [Person: Sue Jones, 100000]
>>> ================================ RESTART ================================
>>> 
tom = [Person: Tom Jones, 100000]
bob = [Person: Bob Smith, 0]
sue = [Person: Sue Jones, 110000.0]
>>> ================================ RESTART ================================
>>> 
tom = [Person: Tom Jones, 100000]
bob = [Person: Bob Smith, 0]
sue = [Person: Sue Jones, 121000.0]
>>> ================================ RESTART ================================
>>> 
tom = [Person: Tom Jones, 100000]
bob = [Person: Bob Smith, 0]
sue = [Person: Sue Jones, 133100.0]
>>> 
>>> 
>>> 
>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>> 
[DEBUG ON]
>>> 
[DEBUG OFF]
>>> 
>>> 
>>>
>>>
>>> import datetime
>>> 
>>> dir(datetime)
['MAXYEAR', 'MINYEAR', '__doc__', '__name__', '__package__', 'date', 'datetime', 'datetime_CAPI', 'time', 'timedelta', 'tzinfo']
>>>
>>>
>>> 
>>> import time
>>> dir(time)
['__doc__', '__name__', '__package__', 'accept2dyear', 'altzone', 'asctime', 'clock', 'ctime', 'daylight', 'gmtime', 'localtime', 'mktime', 'sleep', 'strftime', 'strptime', 'struct_time', 'time', 'timezone', 'tzname']
>>>
>>> help(time.strftime)
Help on built-in function strftime in module time:

strftime(...)
    strftime(format[, tuple]) -> string
    
    Convert a time tuple to a string according to a format specification.
    See the library reference manual for formatting codes. When the time tuple
    is not present, current time as returned by localtime() is used.

>>>
>>> help(time)
Help on built-in module time:

NAME
    time - This module provides various functions to manipulate time values.

FILE
    (built-in)

DESCRIPTION
...
...etc
...
DATA
    accept2dyear = 1
    altzone = 25200
    daylight = 1
    timezone = 28800
    tzname = ('Pacific Standard Time', 'Pacific Daylight Time')

>>> 


# see the Web for resources related to other topics surveyed late in class
