swig c binding

Discussion in 'Python' started by stash, Nov 25, 2003.

  1. stash

    stash Guest

    I have the following struct in my c header file:

    typedef struct _Foobar {
    double foo;
    double bar[3];
    } Foobar;

    I have wrapped it in swig and it appears to have worked...
    In my python file now:

    import foobar
    x = foobar.Foobar()
    x.foo = 3.14 #works
    x.bar = (1.2, 2.3, 3.4) #returns an error

    What have I gotten confused here? I've tried some things with the
    carrays.i, but didn't really get anywhere. What is the proper syntax?
    I eventually want to turn x into a byte stream and send it over a
    serial port.
     
    stash, Nov 25, 2003
    #1
    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. Jordan
    Replies:
    2
    Views:
    2,549
    Jordan
    Feb 10, 2004
  2. Amit
    Replies:
    6
    Views:
    13,854
    Assimalyst
    Oct 24, 2006
  3. Replies:
    2
    Views:
    883
    Kevin Grover
    Oct 20, 2006
  4. JcFx
    Replies:
    0
    Views:
    293
  5. Vivek Nallur

    value binding and function binding

    Vivek Nallur, Sep 25, 2003, in forum: Ruby
    Replies:
    0
    Views:
    143
    Vivek Nallur
    Sep 25, 2003
Loading...

Share This Page