def shell_quote(text):
 return u"\\'".join(((u"'%s'" % p) for p in text.split(u"'")))

def shell_quote ( text ) : return u"\\'" . join ( ( ( u"'%s'" % p ) for p in text . split ( u"'" ) ) )
quote text for inserting into a shell .