_comment.py 文件源码

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

项目:idascripts 作者: ctfhacker 项目源码 文件源码
def _escape(cls, iterable):
        try:
            while True:
                ch = next(iterable)
                # if it's a single backslash, then double it.
                if ch == '\\':
                    yield '\\'
                    yield '\\'
                # if it's a known escapable character, then return it
                elif ch in cls.cmap:
                    yield '\\'
                    yield cls.cmap[ch]
                # otherwise, it should be printable and doesn't need to be escaped
                elif ch in string.printable:
                    yield ch
                # we don't know, so let python handle it
                else:
                    # FIXME: replace this repr() hack with a proper \x encoding
                    yield repr(ch)[1:-1]
        except StopIteration: pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号