Creating arrays (builtin) in C Extensions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • iwl

    Creating arrays (builtin) in C Extensions

    Hello,

    there is an builtin documented array module in phyton,
    but no documentation how such an array can be
    created in C-Extension functions.
    So I have to use Lists at time, but this is I think
    inefficient with large data sets.

    Is there some interface aviable which I can link to my
    Programm without any change to standard python?

  • Duncan Booth

    #2
    Re: Creating arrays (builtin) in C Extensions

    "iwl" <Ingo.Wolf@gmx. dewrote:
    there is an builtin documented array module in phyton,
    but no documentation how such an array can be
    created in C-Extension functions.
    I would guess you create an array from C the same way you create any other
    Python objects. So call PyImport_Import Module to get the array module, get
    its 'array' attribute with PyObject_GetAtt rString then call PyObject_New to
    create your array.

    There is documentation on how to set the data in the array. See

    Comment

    Working...