当前日期格式化:
time.strftime('%Y-%m-%d',time.localtime(time.time()))
pprint:
import pprint
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(stuff)
或
import pprint
pprint.pprint(stuff)
django 模板遍历dict:
{% for k,v in item.items %}
{{k}}{{v}}
{% endfor %}
编码:
\x ascii编码
\u unicode编码 decode('utf-8')