Help need with converting Hex string to IEEE format float

Fredrik Lundh fredrik at pythonware.com
Tue Dec 14 17:07:56 CET 2004


>    # convert to byte string, via the array module
>    import array, struct
>    a = array.array("B", [int(c, 16) for c in x])
>    v = struct.unpack("!f", )

eh?  should be:

    # convert to byte string, via the array module
    import array, struct
    a = array.array("B", [int(c, 16) for c in x])
    v = struct.unpack("!f", a)

</F> 






More information about the Python-list mailing list