当前日期格式化:

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')
posted on 2017-07-31 17:52  HeJD  阅读(140)  评论(0编辑  收藏  举报