Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (2)
Regular expression of Python
no vote
Several common points of regular expression in Python, Including: 1 import, 2: metacharacter and so on, content preview: metacharacter # - D matches any decimal number; equivalent to [0-9] # - D matches any non numeric character; equivalent to [^ 0-9] # - s matches any white space character; equivalent to [^ t / N / R / F / v] # - s matches any non white space character; equivalent to [^ t / N / R / F / v] # - W matches any alphanumeric character; equivalent to [a-za-z0-9]_ ]#- W matches any non alphanumeric character; equivalent to [^ a-za-z0-9]_ ]#Match a word boundary, which refers to the position between the word and the space
stven_zhz
2018-02-10
0
1
Several simple examples of Python decorator
no vote
Eight examples briefly introduce the implementation of Python decorator. Including parameters, execution effect, etc.: # / usr / bin / env Python#-*- coding:utf-8 - *-&The execution order of the two decorators is outer_ 0 & nbsp; & nbsp; & nbsp; enter the first outer at the beginning_ 1 & nbsp; & nbsp; & nbsp; 123 primitive function_ 1     456outer_ 0 & nbsp; & nbsp; & nbsp; the result of addition is equal to & quot; & quot; & quot;, which decorator executes first, which decorator executes first_ 0 and outer_ In fact, you can also put a decorator out_ 1 is passed into the outer as a parameter_ 0 # decorator is mainly used to set def outer_ 0 (func): & nbsp; & nbsp; def inner (* args, * * kwargs): & nbsp; & nbsp; & nbsp; print & quot; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; return = func (* args, * * kwargs) & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; print & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; return & nbsp; & nbsp; return inner deffer_ 1(func):    def inner(*args, **kwargs):        print("123")        ret = func(*args, **kwargs)      &
stven_zhz
2018-01-11
0
1
No more~