ascii2dec

Uwe Mayer merkosh at hadiko.de
Wed Aug 20 13:41:21 EDT 2003


Hi,

this must sound stupid to you, but I'm ages out of Python and I just can't
find a function to convert 4 bytes of binary data to an integer value:

length=f.read(4)    # get length in binary
length=socket.htonl(length)    # swap bytes

#convert 4 bytes to integer

f.close()

Thanks for any help
Uwe
-- 
        




More information about the Python-list mailing list