Boost logo

Boost Users :

From: Vladimir Prus (yg-boost-users_at_[hidden])
Date: 2003-07-11 00:51:58


BP wrote:

> I would like to use the Boost Graph Library (BGL), but
> I'm not much of a C++ programmer. I'd feel much more
> comfortable working in Python.
>
> Can I download the Boost Graph Library wrapped in
> Boost.Python? I'd rather not wrap myself if it
> already exists.
>
> Thanks.

Hello,

I'm not aware of such wrapping. Also note that BGL is almost completely
template code. This means that you can wrap only specific type of graph.
Besides, most operations on graphs are implemented as free functions.

So, to wrap BGL you'd need:
1. Define your own concrete (non-template) graph class which will define
appropriate member functions.
2. Wrap that class with Boost.Python.

This should not be too hard. For example, with the attached C++ code I can
achieve:

>>> import graph
>>> g = graph.Graph()
>>> g.add_vertex()
   0
>>> g.add_vertex()
   1
>>> print g
   digraph G {
   0;
   1;
   }

OTOH, I really don't have the time to make full-blown wrapping myself...

- Volodya

[Non-text portions of this message have been removed]


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