Skip to content Skip to sidebar Skip to footer

How Do I Access Class Fields In Python Graph-tool Property Maps?

I'm trying to draw a graph with a class as a vertex property. How do I draw the graph with the vertex_text set to the name field of the classes they contain? from graph_tool.all im

Solution 1:

The code example you give is full of basic errors. You define vprop but then you use v_prop. The code would not work in any case, as the property map is defined to be of string type, but you are setting to it a class object.

But answer to the underlying question is simply to set a the names to a string property map and use that.

Post a Comment for "How Do I Access Class Fields In Python Graph-tool Property Maps?"