basic.py 文件源码

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

项目:PokeDuino 作者: tzwenn 项目源码 文件源码
def Pokearray(length):

    # okay, I learned. 
    # It's not possible to use a custom base class
    # in a ctypes.Structure field. Forget about it

    @classmethod
    def fromBytes(cls, data):
        return cls(*data)

    def asBytes(self):
        return bytes(iter(self))

    t = ctypes.c_uint8 * length
    t.fromBytes = fromBytes
    t.bytes = asBytes
    return t
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号