URL_DICT = dict() def route(url): def set_func(func): URL_DICT[url] = func def call_func(): func() return call_func return set_func @route('center_p') def center_p(): pass @route('index_p') def index_p(): pass DEF file application (the env, The start_response): '' ' the env is an empty dictionary, The start_response is quoted web server in a method, a function return the body ' '' The start_response ( ' 200 is the OK ' , [( ' the Content-the Type ' , ' text / HTML; charset = UTF-. 8 ' )]) file_name = env['PATH INFO'] the try : return URL_DICT [file_name] () the except Exception AS RET: return ' an abnormality S% ' % STR (RET)