Adorner:
1, the adorner is a function, at least two layers of function.
2, for example @auth: Perform auth ah function, decorated function as parameter auth (foo)
The return value of the AUTH function, assigned to the function name of the decorated function.
3, dynamic parameters, can decorate a function containing n parameters.
4. function return value
5, Multi-decorator box model
6, three layers, three layers of how to use.
Performs a step more than the original adorner, executes the function first, gets the return value as a function, and the @ return value, even if the ordinary adorner
@w1:
1. Execute W1 function
2. Assign the return value of the W1 function to the function name of the function being decorated.
Key = kwargs[' token ']
del.kwargs[' token ']
def Filter (A1,A2):
def outer (Main_func):
def wrapper (Request,kargs):
Print A1
Main_result = Main_func (Request,kargs)
Print A2
Return Main_result
Return wrapper
return outer
@Filter (F5, F6)
def Index (Request,kargs):
print ' index '
Recursion:
Calculator
Reading consists of only +-*/and numbers, divided into three parts,
The result is stitched into a new expression to assign a value to B
Get the final result by function recursive invocation
Module:
1. Built-in module
2. Customize a block
3. Third-party modules
Modules exist in two ways:. Py "Folder"
Import Module Mode:
1. Import Sys
2. From sys import argv
Alias:
From sys import ARGV as test
Sys.path Default Path Lookup
_init_.py: Folder module must have a file, or folder module error, cannot be called.
Built-in modules:
One: OS system-related
Two: SYS interpreter-related
Third, configparser processing configuration file, special format, a section an option
Iv. Hashlib for encryption-related operation add salt operation, place crack
Python Basic Content Five