main.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:PYKE 作者: muddyfish 项目源码 文件源码
def print_nodes():
    import string
    print("\n".join(sorted(nodes.nodes.keys())))
    used_chars = sorted(node.char for node in nodes.nodes.values())
    used_chars += list("0123456789.()")
    printable = string.printable[:-5]
    print("".join(char*(char in used_chars)or" " for char in printable))
    print(printable)
    print("".join(char*(char not in used_chars)or" " for char in printable))    
    print(" ".join(char for char in used_chars if char not in printable and char != "\n"))
    chars = {}
    for node in nodes.nodes.values():
        if node.char in chars:
            if node.char == "":
                continue
            print("DUPLICATE CHARS: %r and %r"%(chars[node.char], node))
        else:
            chars[node.char] = node
    print(chars[input("Char? ")].__name__)
    sys.exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号