[code.view]

[top] / python / PyMOTW / struct / struct_unpack.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """
     """
     
     __version__ = "$Id$"
     #end_pymotw_header
     
     import struct
     import binascii
     
     packed_data = binascii.unhexlify('0100000061620000cdcc2c40')
     
     s = struct.Struct('I 2s f')
     unpacked_data = s.unpack(packed_data)
     print 'Unpacked Values:', unpacked_data
     

[top] / python / PyMOTW / struct / struct_unpack.py

contact | logmethods.com