This is a call graph output method that can be used when finding a processing speed bottleneck or when checking the interrelationship of objects. (Windows environment)
Install pycallgraph. (Introduction of Graphviz is a prerequisite)
$ pip install pycallgraph
Copy C: \ Python34 \ Scripts \ pycallgraph to the root of your project. (If you play with sys.path, you may not need to copy it. Environment variables seem to be useless.)
Launch the shell at the root of the project where you want to see the call graph. Run pycallgraph.
$ python pycallgraph graphviz-./filename.py
Since the program is executed, perform the process you want to draw the call graph.
When you exit the program, pycallgraph.png will be created in the current directory.
There may be a more correct way.
(Output result when creating an empty window with PySide)
It might be easier to write a process to add a filter to the config of C: \ Python34 \ Lib \ site-packages \ pycallgraph \ pycallgraph.py.
~~ When outputting in a format such as DOT or SVG, or changing the output file name, C:\Python34\Lib\site-packages\pycallgraph\output\graphviz.py It is possible for the time being by changing the initial value in init. ~~ ** [2015.05.03 postscript] I was able to specify it with --output-format **
As mentioned in the source, the format can specify the following types. Output Formats | Graphviz - Graph Visualization Software
Recommended Posts