[C++-sig] [newbie] wrapping a class with argc and argv

Dioselin Gonzalez dioselin at purdue.edu
Tue Jul 13 01:26:58 CEST 2004


Hi everybody! a couple of questions from a newbie learning boost.python

(1) I want to wrap a class which takes arguments from the command line:
class foo {
foo(int *argc, char **argv);
<...>}

I would like to have a class in python like this:
import sys
myfoo = foo(len(sys.argv), sys.argv)

How do I define it?  From what I read, I could use arg_from_python or a 
thin wrapper for this, but I can't find any examples on how they work.  
Would anybody help me with a sample code?

(2) Where can I get sample codes for boost.python? There are a lot of 
documents explaining the "theory", but sometimes they are pretty obscure 
without examples.

Thanks!

Dioselin.-





More information about the Cplusplus-sig mailing list