コード例 #1
0
def print_as_hex(block_codepoints):
    line = ""
    for block in block_codepoints:
        byte_no = bits2codepoint(block)
        character = chr(byte_no)
        line += hex(byte_no)
    print line
コード例 #2
0
def print_block_table(block_codepoints):
    for block in block_codepoints:
        byte_no = bits2codepoint(block)
        character = chr(byte_no)
        print "%s %4s %3s %s" % (
            list2str(block), hex(byte_no), byte_no, repr(character)
        )
コード例 #3
0
ファイル: bitstream_handler.py プロジェクト: jedie/PyDragon32
def print_as_hex(block_codepoints):
    line = ""
    for block in block_codepoints:
        byte_no = bits2codepoint(block)
        character = chr(byte_no)
        line += hex(byte_no)
    print line
コード例 #4
0
    def write_codepoint(self, codepoints):
        written_codepoints = []
        bits = []
        for bit in codepoints2bitstream(codepoints):
            bits.append(bit)
            if len(bits) == 8:
                written_codepoints.append(bits2codepoint(bits))
                bits = []
                
            if bit == 0:
#                 wavefile.writeframes(self.bit_nul_samples)
                self.wavefile.writeframes(self.bit_nul_samples)
            elif bit == 1:
#                 wavefile.writeframes(self.bit_one_samples)
                self.wavefile.writeframes(self.bit_one_samples)
            else:
                raise TypeError
        log.debug("Written at %s: %s" % (
            self.pformat_pos(), ",".join([hex(x) for x in written_codepoints])
        ))
コード例 #5
0
ファイル: bitstream_handler.py プロジェクト: jedie/PyDragon32
def print_block_table(block_codepoints):
    for block in block_codepoints:
        byte_no = bits2codepoint(block)
        character = chr(byte_no)
        print "%s %4s %3s %s" % (list2str(block), hex(byte_no), byte_no,
                                 repr(character))