struct.pack returns nothing [2]

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • andmarti@gmail.com

    #1

    struct.pack returns nothing [2]

    On Mon, Mar 19, 2007 at 02:12:39AM -0300, andmarti@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.
    ---------------------------------------------
  • kyosohma@gmail.com

    #2
    Re: struct.pack returns nothing [2]

    On Mar 19, 12:22 am, andma...@gmail. com wrote:
    On Mon, Mar 19, 2007 at 02:12:39AM -0300, andma...@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\x 00'

    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:

    Source code: Lib/struct.py This module converts between Python values and C structs represented as Python bytes objects. Compact format strings describe the intended conversions to/from Python valu...


    This may be helpful to you as well:



    Mike

    Comment

    Working...