Piet van Oostrum wrote:
...
You have the string wrong.

oops yea.

But the correct one you get with:

In [67]: import struct

In [68]: number = 252509952

In [69]: struct.pack('>I', number)
Out[69]: '\x0f\x0c\xff\x00'

(Please note that this is big endian)

thanks a lot, but it does not work for large integers:

 >>> number
 283691163101781L
 >>> struct.pack('>I', number)
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 OverflowError: long int too large to convert
 >>>

bye
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to