Help need with converting Hex string to IEEE format float

Fredrik Lundh fredrik at pythonware.com
Tue Dec 14 11:07:56 EST 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