当前位置: 首页>>代码示例>>Python>>正文


Python binascii.rlecode_hqx方法代码示例

本文整理汇总了Python中binascii.rlecode_hqx方法的典型用法代码示例。如果您正苦于以下问题:Python binascii.rlecode_hqx方法的具体用法?Python binascii.rlecode_hqx怎么用?Python binascii.rlecode_hqx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在binascii的用法示例。


在下文中一共展示了binascii.rlecode_hqx方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: write

# 需要导入模块: import binascii [as 别名]
# 或者: from binascii import rlecode_hqx [as 别名]
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
开发者ID:glmcdona,项目名称:meddle,代码行数:9,代码来源:binhex.py

示例2: close

# 需要导入模块: import binascii [as 别名]
# 或者: from binascii import rlecode_hqx [as 别名]
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
开发者ID:glmcdona,项目名称:meddle,代码行数:8,代码来源:binhex.py

示例3: test_hqx

# 需要导入模块: import binascii [as 别名]
# 或者: from binascii import rlecode_hqx [as 别名]
def test_hqx(self):
        # Perform binhex4 style RLE-compression
        # Then calculate the hexbin4 binary-to-ASCII translation
        rle = binascii.rlecode_hqx(self.data)
        a = binascii.b2a_hqx(self.type2test(rle))
        b, _ = binascii.a2b_hqx(self.type2test(a))
        res = binascii.rledecode_hqx(b)

        self.assertEqual(res, self.rawdata) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:11,代码来源:test_binascii.py

示例4: test_not_implemented

# 需要导入模块: import binascii [as 别名]
# 或者: from binascii import rlecode_hqx [as 别名]
def test_not_implemented(self):
        test_cases = [
                        lambda: binascii.a2b_qp(None),
                        lambda: binascii.a2b_qp(None, None),
                        lambda: binascii.a2b_hqx(None),
                        lambda: binascii.rledecode_hqx(None),
                        lambda: binascii.rlecode_hqx(None),
                        lambda: binascii.b2a_hqx(None),
                        ]
        for temp_func in test_cases:
            self.assertRaises(NotImplementedError, temp_func) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:test_binascii.py

示例5: write

# 需要导入模块: import binascii [as 别名]
# 或者: from binascii import rlecode_hqx [as 别名]
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = b'' 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:9,代码来源:binhex.py


注:本文中的binascii.rlecode_hqx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。