How to use list type generated by SWIG?

Discussion in 'Python' started by Bryan, Jan 10, 2010.

  1. Bryan

    Bryan Guest

    I am writing a small script to manage my ipod. I am using the python
    bindings for libgpod. I have never used swig, or used python to
    program against a c/c++ library.

    I can get the library to find my ipod, and parse its DB format, but
    I'm not sure how to interact with the types that some of the functions
    return, specifically a Swig Glist (gtk's doubly-linked list)

    import gpod
    db = gpod.itdb_parse('/media/ipod', None)
    print db.tracks
    >>><Swig Object of type 'GList *' at 0xa2536b0>


    Glist is not iterable or subscriptable. It contains a 'next' function
    which always seems to return None after printing "swig/python detected
    a memory leak of type 'GList *', no destructor found." to the console.

    How can I interact with this list?
     
    Bryan, Jan 10, 2010
    #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. julia

    SWIG generated... TypeError

    julia, Sep 27, 2004, in forum: Python
    Replies:
    0
    Views:
    444
    julia
    Sep 27, 2004
  2. Bo Peng
    Replies:
    0
    Views:
    318
    Bo Peng
    Feb 2, 2005
  3. Replies:
    0
    Views:
    348
  4. MRAB
    Replies:
    0
    Views:
    439
  5. Lyes Amazouz
    Replies:
    2
    Views:
    305
    Lyes Amazouz
    Aug 20, 2008
Loading...

Share This Page