En Mon, 19 Mar 2007 02:39:01 -0300, <[EMAIL PROTECTED]> escribió: > On Sun, Mar 18, 2007 at 10:22:32PM -0700, Alex Martelli wrote: >> <[EMAIL PROTECTED]> wrote: >> >> > import struct >> > print struck.pack ('i', 1) >> > >> > it returns a '\n'. >> > What's wrong with it??? >> > :( >> >> You're trying to print a binary string that's hardly printable as-is. >> Try printing its repr(...) and you'll see all the binary zeros and one >> you crave!-) > > Im getting nothing as well. > The unpack seems to work fine though.
Works fine for me: py> import struct py> print repr(struct.pack('i',1)) '\x01\x00\x00\x00' -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list