On 06/01/2012 01:45 AM, Héctor Urbina wrote:
> I have the following code:
> 
> sortedEdges = []
> g = Graph()
> g.graph_properties["sortedEdges"] =
> self._graph.new_graph_property("object", sortedEdges)
> 
> then I fill the sortedEdges list with the appropriate values and
> return g. Now, how can I get the list of sorted edges from g? I'm also
> saving a dictionary that uses the names of the vertices as keys and
> the graph vertices as values in a internal graph property map; so, in
> general, I want to learn how to use any python object after it is
> saved as graph_property

The syntax for graph properties is the same as for vertex or edge
properties, i.e. you use the graph itself as a key. In your case it would be:

   g.graph_properties["sortedEdges"][g].append("foo")

This would append the value "foo" to your list.

Cheers,
Tiago

--
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
http://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to