struct.pack returns nothing [2]

Discussion in 'Python' started by andmarti@gmail.com, Mar 19, 2007.

  1. Guest

    On Mon, Mar 19, 2007 at 02:12:39AM -0300, 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.
    ---------------------------------------------
    , Mar 19, 2007
    #1
    1. Advertising

  2. Guest

    On Mar 19, 12:22 am, wrote:
    > On Mon, Mar 19, 2007 at 02:12:39AM -0300, 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
    , Mar 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Fogelklou
    Replies:
    36
    Views:
    1,371
    Chris Fogelklou
    Apr 20, 2004
  2. Tim Jones
    Replies:
    0
    Views:
    376
    Tim Jones
    Jan 31, 2004
  3. Replies:
    5
    Views:
    260
    Gabriel Genellina
    Mar 19, 2007
  4. Devin Jeanpierre
    Replies:
    2
    Views:
    451
    Devin Jeanpierre
    Feb 14, 2012
  5. Alexander Farber

    pack 'C3U*' not same as pack 'C3(xC)*'

    Alexander Farber, Jun 23, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    134
    Ilmari Karonen
    Jun 23, 2005
Loading...

Share This Page