[Pyrex] Function wrapping problems

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Oct 15 04:02:03 CEST 2003


Bob Ippolito <bob at redivi.com>:

>      for arg in args:
>        argv[i] = PyString_FromString(arg)

I think you mean PyString_AsString here. But you don't need
to do that, all you need is

         argv[i] = arg

since Pyrex will automatically turn the Python string into
a char *.

This assumes that the Eiffel code doesn't require the memory
occupied by the arg strings to live any longer than the call
to your Pyrex function. If that's not the case, you'll have
to strcpy them, or equivalent.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list