Skip to content

Instantly share code, notes, and snippets.

def txt2html(txt):
'''将txt以行为单位加上<li></li>标签'''
def escape(txt):
'''将txt文本中的空格、&、<、>、(")、(')转化成对应的的字符实体,以方便在html上显示'''
txt = txt.replace('&','&#38;')
txt = txt.replace(' ','&#160;')
txt = txt.replace('<','&#60;')
txt = txt.replace('>','&#62;')
txt = txt.replace('"','&#34;')
txt = txt.replace('\'','&#39;')
@mickhan
mickhan / redis-ve
Created January 31, 2013 04:01 — forked from pterk/redis-ve
#!/bin/bash
VERSION="2.6.2"
ARCHIVE=redis-${VERSION}.tar.gz
if [ -z "${VIRTUAL_ENV}" ]; then
echo "Please activate a virtualenv first";
exit
fi