The simplest solutions are nearly always best: Make it a string, and transfer that, rather than a binary floating point representation. That way, you don't have to worry about differences in floating point representation or how to make Python "understand" your binary floating point value.
Edit1: However, if you transfer a 32-bit integer to a Python data
object: I expect floatdata = struct.unpack("f", data)
should do the trick.
Edit2: Documentation for struct.unpack
(and struct.pack
)
Edit3: The struct.unpack
does assume both machines use the same floating point format. This means the software isn't widely portable. But it should work ok on most commonly available platforms.