struct.pack returns nothing

andmarti at gmail.com andmarti at gmail.com
Mon Mar 19 01:39:01 EDT 2007


On Sun, Mar 18, 2007 at 10:22:32PM -0700, Alex Martelli wrote:
> <andmarti at gmail.com> wrote:
> 
> > If I build a strict with:
> > 
> > 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.

-- 
Andrés M.
---------------------------------------------



More information about the Python-list mailing list