SWIG: Python list to uint32_t *?

Posted by Lee Crabtree on Stack Overflow See other posts from Stack Overflow or by Lee Crabtree
Published on 2010-03-23T21:00:17Z Indexed on 2010/03/23 21:03 UTC
Read the original article Hit count: 613

Filed under:
|
|

I'm trying to work with a Python module that was generated by SWIG. There's a C++ class defined that works like this (simplified):

namespace Foo
{
    class Thing
    {
    public:
        Thing();
        ~Thing();

        bool DoSomething(uint32_t x, uint32_t y, uint32_t z, uint32_t *buffer);
    };
};

When I try to call it from Python, I get an error about the last argument needing to be of type 'uint32_t*'. Normal Python integers work just fine for the other arguments, so I can't understand why a list of ints wouldn't work for the buffer. Any suggestions?

© Stack Overflow or respective owner

Related posts about swig

Related posts about python