import string


def printable_substring(the_str):
    """Returns the printable subset of the_str

    :param str the_str: a putative string
    :return str the_pr_str: the portion of the_str from index 0 that is printable
    """
    i = 0
    the_pr_str = ''
    while i < len(the_str):
        if the_str[i] in string.printable:
            the_pr_str += the_str[i]
            i += 1
        else:
            return the_pr_str
    return the_pr_str