def python(cc):
    """Format the character for a Python string."""
    codepoint = ord(cc)
    if 0x20 <= codepoint <= 0x7f:
        return cc
    if codepoint > 0xFFFF:
        return "\\U%08x" % codepoint
    return "\\u%04x" % codepoint