Question concerning array.array and C++

Discussion in 'Python' started by Fabio, Nov 5, 2008.

  1. Fabio

    Fabio Guest

    Hi All,
    I have a question concerning the use of array.array inside of C++ code I
    wrote.

    I am working with _big_ data files but some entries in these files are
    usually bounded say between -5 to 40. Returning a Python list makes no
    sense. In Python I always work with the array.array module which does
    the trick. But now that I wrote my own C++ module for some preprocessing
    I need the return array.array objects.

    Consider the object

    array.array('c',[40,40,40])

    Can I create such an object from within the C++ layer and pass it to the
    Python layer?

    I already looked at arraymodule.c and tried to link the arraymodule.o
    file to my code but then I have to mess around with extern "C" and the
    like and it gets really messy.

    Any help would be great!

    Fabio
    Fabio, Nov 5, 2008
    #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. Deryck
    Replies:
    12
    Views:
    704
  2. Jatinder Singh
    Replies:
    4
    Views:
    427
    Steve Holden
    Jun 1, 2005
  3. Sean Quinn
    Replies:
    4
    Views:
    296
    Sean Quinn
    Jul 16, 2005
  4. SStory
    Replies:
    1
    Views:
    132
    SStory
    Sep 22, 2003
  5. Oliver Andrich
    Replies:
    8
    Views:
    104
    Oliver Andrich
    Dec 7, 2005
Loading...

Share This Page