p25:  
def cheeseshop(kind,*arguments,**keywords):
       for arg in arguments:
            print arg
       keys=sorted(keywords.keys())
       for kw in keys:
           print kw,":",keywords[kw]
that *arguments must occur before **keywords.
cheeseshop("Limburger", "It’s very runny, sir.","It’s really very, VERY runny, sir.",
shopkeeper=’Michael Palin’,client="John Cleese",sketch="Cheese Shop Sketch")
2.sort usage:
pairs = [(1, ’one’), (2, ’two’), (3, ’three’), (4, ’four’)]
pairs.sort(key=lambda pair: pair[1])
p29:
list 可以作为一个队列,数组,栈来用。支持下标索引,排序,逆序,插入,删除,拓展等功能
当然了,list作为一个队列来用的时候,效率并不高,因为涉及大量的元素移位操作,因此我们可以使用collections.deque
(1) filter(function,sequence)  return a sequence ..that function(item) is true
(2) map(function,sequence)     return a sequence
(3)reduce(function,sequence)  returns a single value constructed by calling the binary function function
on the first two items of the sequence, then on the result and the next item, and so on.
p35:
(1) tuple
不可更改,操作与list类似
 
(2) set
没有重复元素,
(3) dictionaries
p36:
enumerate()  返回索引和索引值的pair 对的迭代器
for q, a in zip(questions, answers):
    print ’What is your {0}? It is {1}.’.format(q, a)
*当循环使用字典的时候,我们可以使用iteritems()函数来代替上面的enumerate()
p47:
(4) str
 转换成字符串的函数:str()和repr()
 str.format()
 eg.  print '{0} and {1}'.format('span','eggs')
p50:
文件读写:
f.read()
f.readline()
f.readlines()
p52:
用json来储存复杂结构的文件内容
json.dumps([1,'simple'.'list'])
json.dump(x,f)  //储存x到文件f中
x=json.load(f)  //导出文件的结构数据到x
json可以处理列表和字典,对于任意类的实例,json需要做点额外的工作,这个时候我们可以下面这个包:
pickle
---------------------------------------------------------------------------------------
(5) 关于python的类,我想说明如下
    与c++类似,可以有多继承。但是没有所谓的虚函数机制,另外在c++中隐含的this指针在python中相对应的就是self,而且有内置的一些数据成员和函数,对于一个类__init__(self)这样的形式的函数,我们可以看作是内置函数,可以看成是构造函数,同样也有重载的形式,而且在对象生成时,这些函数就有了,也就是说这个是绑定于类对象的,至于隐式自动构造函数,可以从c++中得到启发,从使用的角度来说,python更容易理解,而且也不需要手动释放内存做析构这样的操作,总的来说,可以从c++的类的思维习惯来看待这个python
----------------------------------------------------------------------------------------
p71:
各类包的简单回顾:
(1) os
      os.getcwd()      //return working directory
      os.chdir()
      os.system(command)  //执行系统命令
(2) shutil
    拷贝,移动文件
    copyfile,move
(3) glob
    列出当前文件下的所有文件
    glob.glob('*.py')
p72:
(1) re
 re.findall(patern,string)
 'tea for too'.replace('roo','two')
(2) random()
  random.choice(['apple','pear','banana'])
  random.sample(xrange(100),10)
  random.random()
  random.randrange()
(3) Internet 接入
   urllib2,smtplib两个包
(4) 日期和时间的包
     datetime
(5) 数据压缩的包
    zlib
    t=zlib.compress(s)
    zlib.decompress(t)
(6) 计时的包
    timeit
    from timeit import Timer
    Timer(express).timeit()   //计时
(7) 质量控制的两个包
    doctest,unittest