Get printable characters from the specified string.
    Note that str.isprintable() is not available in Python 2.

def get_printable(iterable):
    """
    Get printable characters from the specified string.
    Note that str.isprintable() is not available in Python 2.
    """
    if iterable:
        return ''.join(i for i in iterable if i in string.printable)
    return ''