Peter Hansen
2002-05-18 02:11:34 UTC
$out = pack("N", $out);
However, I can't figure out how to pack the hex value. I always get an
error: "required argument is not an integer". Python's pack doesn't have
an "N" format, but I think I could use "l!" Help? Please?
Please post your code and the exception traceback so we can tell whatHowever, I can't figure out how to pack the hex value. I always get an
error: "required argument is not an integer". Python's pack doesn't have
an "N" format, but I think I could use "l!" Help? Please?
the problem is directly, rather than guessing.
import struct
struct.pack('l', '5')
struct.pack('l', '5')
File "<stdin>", line 1, in ?
struct.error: required argument is not an integer
struct.pack('l', 5)
And you know about the documentation for struct, right? It tells
what "l" means, and the others. And did you really mean "!l"?
http://www.python.org/doc/current/lib/module-struct.html
-Peter