title:<Dijango Web开发指南>
Author:Jeff Forcier
ISBN:978-7-111-27028-7
匿名函数
sorted(list_of_people, key = lambda person: person.last_name)
* 和 **
* 打开tuple或list
**打开dict
def check_web_server(host, port, path, *args, **kwargs)
Decorator function
def log(func)
def wrappedFunc():
print "*** %s() called" %func.__name__
return wrappedFunc
@log
def foo():
print "inside foo()"
#foo = log(foo)
@decomaker(deco_args)
re模块
import re
m = re.search(r'foo', 'seafood')//re.match 匹配和查找不同
print m
m.group()
m = re.search(r'bar', 'seafood')
print m
导入方式
from Mobile import Analog
import Analog
import Phone.Mobile.Analog as pma
__doc__,help()编写,DRY