Custom Search

Wednesday, February 4, 2015

How to Install Python Object Graphs objgrap

1)
Installation

#sudo apt-get install python-gtk2 graphviz
#pip install objgraph


2) 
Goto python console and draw the graph of a python object in the memory

#python
import objgraph
my_data = [1, 'saju', True, [3], (4,), {'5':5}]
objgraph.show_refs([my_data], filename='sample-graph.png')


3)
Open the graph image "sample-graph.png"

No comments:

Post a Comment