Boost logo

Boost Users :

From: Wyatt Greenway (th317erd_at_[hidden])
Date: 2005-10-02 16:17:18


Hello! I want to do the following with Boost::Python:

class A
{
 public:
  std::string Value;
};

class B
{
 public:
  A Str;
  int Val;
};

/* Boost::Code */

class_<A>("A")
.def("Value", &A::Value)
;

class_<B>("B")
.def("Str", &B::Str)
.def("Val", &B::Val)
;

/*---------*/

I then wish to do this in Python:
###############

MyB = B()
B.Str = "Some string"

print "String: %s"%B.Str

# The output should be as follows:

> String: Some string

How do I acomplish this?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net