[C++-sig] converting python list of strings to char *[]

Roman Yakovenko roman.yakovenko at gmail.com
Thu Mar 23 14:46:07 CET 2006


On 3/23/06, Nat Goodspeed <ngoodspeed at solidworks.com> wrote:
> > -----Original Message-----
> > From: c++-sig-bounces at python.org [mailto:c++-sig-bounces at python.org]
> On
> > Behalf Of Abhi
> > Sent: Wednesday, March 22, 2006 7:59 PM
> > To: c++-sig at python.org
> > Subject: [C++-sig] converting python list of strings to char *[]
> >
> > I have functions such as
> > int run(int argc, char* argv[])
> > which needs to be exported to python using Boost.Python.
> >
> > How do I pass to the char *argv[] from python?
>
> [Nat] Depending on how many such functions you have, wouldn't it be
> simpler to publish thin wrappers? In this case the run() function you
> call from Python would be defined to accept a list of Python strings,
> and would then construct both arguments for the real run() function from
> that list.
>
> If you have many such functions, is it possible that pyplusplus would
> generate such wrappers automatically? (I'm not familiar with pyplusplus
> beyond the traffic I've seen here over the past few months.)

Right now pyplusplus does not generate wrapper for such functions.
Also it should be pretty simple to teach it.


--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list