Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 1
---
# Python 简介
@su27 and @menghan
---
-
高级
-
易学易读易维护
# !/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import sys | |
import time | |
import Queue | |
import threading | |
import traceback | |
class ExitException(Exception): |
import time, functools | |
def timeit(func): | |
@functools.wraps(func) | |
def __do__(*args,**kwargs): | |
start = time.time() | |
result= func(*args,**kwargs) | |
print '%s used time %ss'%(func.__name__,time.time()-start) | |
return result | |
return __do__ |
""" | |
Using Jinja2 with Django 1.2 | |
Based on: http://djangosnippets.org/snippets/2063/ | |
To use: | |
* Add this template loader to settings: `TEMPLATE_LOADERS` | |
* Add template dirs to settings: `JINJA2_TEMPLATE_DIRS` | |
If in template debug mode - we fire the template rendered signal, which allows | |
debugging the context with the debug toolbar. Viewing source currently doesnt |