struct.pack returns nothing [2]

kyosohma at gmail.com kyosohma at gmail.com
Mon Mar 19 22:12:53 CET 2007


On Mar 19, 12:22 am, andma... at gmail.com wrote:
> On Mon, Mar 19, 2007 at 02:12:39AM -0300, andma... at gmail.com wrote:
> > If I build a strict with:
>
> Sorry, I meant script.
>
> > import struct
> > print struck.pack ('i', 1)
>
> > it returns a '\n'.
> > What's wrong with it???
> > :(
>
> --
> Andrés M.
> ---------------------------------------------

When I run it, I get '\x01\x00\x00\x00'

This is my first time using the module, so I really can't be of much
help. I recommend that you read the docs at:

http://docs.python.org/lib/module-struct.html

This may be helpful to you as well:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498149

Mike




More information about the Python-list mailing list