blog/app/util/__init__.py
def string_to_handle(s):
    """ Turns a string into a handle, suitable for use as a URL. """

    s = s.lower()
    trans_table = str.maketrans('', '', string.punctuation)
    s = s.translate(trans_table)
    s = s.replace(" ", "_")

    return s
 Turns a string into a handle, suitable for use as a URL. 
Turns a string into a handle, suitable for use as a URL.
Turns a string into a handle suitable for use as a URL .
def string_to_handle(s):
    s = s.lower()
    trans_table = str.maketrans('', '', string.punctuation)
    s = s.translate(trans_table)
    s = s.replace(" ", "_")
    return s
def string_to_handle ( s ) : s = s . lower ( ) trans_table = str . maketrans ( '' , '' , string . punctuation ) s = s . translate ( trans_table ) s = s . replace ( " " , "_" ) return s
Turns a string into a handle, suitable for use as a URL.
Turns a string into a handle suitable for use as a URL .
""" Turns a string into a handle, suitable for use as a URL. """
s