摘要:
line是模板中一行的内容,类似: {{x}}testinfo{{x+10}} x=10时,模板输出: 10testinfo20 阅读全文
posted @ 2017-02-22 20:28
鸪斑兔
阅读(444)
评论(0)
推荐(0)
摘要:
>>> hobbies = ['software'] >>> ('notchecked', 'checked')['software' in hobbies] 'checked' >>> 'checked' if 'software' in hobbies else 'notchecked' 'checked' >>> hobbies = ['xxx'] >& 阅读全文
posted @ 2017-02-10 16:36
鸪斑兔
阅读(151)
评论(0)
推荐(0)
摘要:
一个带有参数的装饰器的例子: bottle.py中自动转换参数类型的装饰器: 阅读全文
posted @ 2017-02-06 10:24
鸪斑兔
阅读(1815)
评论(0)
推荐(0)
摘要:
import re class SimpleTemplate(object): re_block = re.compile(r'^\s*%\s*((if|elif|else|try|except|finally|for|while|with).*:)\s*$') re_end = re.compile(r'^\s*%\s*end(.*?)\s*$') re_cod... 阅读全文
posted @ 2017-02-04 10:35
鸪斑兔
阅读(255)
评论(0)
推荐(0)
浙公网安备 33010602011771号