Printer.py 文件源码

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

项目:OpenFL 作者: Formlabs 项目源码 文件源码
def _encode(cls, payload):
        """ Protects a stream of data with escape characters
            The payload should be a bytestring
        """
        out = b''
        for byte in payload:
            if byte >= cls.ESCAPE:
                out += bytearray([cls.ESCAPE])
                byte = ctypes.c_uint8(byte - cls.ESCAPE).value
            out += bytearray([byte])
        return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号