lihuanshuai
4/12/2015 - 6:26 AM

Make Text Short

Make Text Short

#-*- coding: utf8 -*-

def short_text(text, length=200):
    if len(text) > length:
        return text[:length] + ' ......'
    else:
        return text