En Mon, 25 Aug 2008 17:31:22 -0300, Hendrik van Rooyen <[EMAIL PROTECTED]> escribió: > Patrick Maupin <pmau....ail.com> wrote: > >>But let me get this straight: Are you just complaining that if you >>pass a string to an arbitrary C function using ctypes, that that >>arbitrary function can modify the string? > > Actually, I am not complaining - I am asking for advice on the side > effects of what I am doing, which is replacing a bunch of bits > in what is essentially an output bit field with the corresponding > input bits at the same addresses read back from a simulated i/o > bus structure. And I would also like to know if there is a better > way of doing this.
To avoid altering the equilibrium of the whole universe, use ctypes.create_string_buffer: http://python.net/crew/theller/ctypes/tutorial.html#fundamental-data-types -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list