发布于 2020-01-09 12:21:40
在这里,我觉得有点愧疚,因为我只是利用@ most -莫妮卡--S和“阿尔伯特--S”的评论--给出了大部分答案,但我认为我只是为了另一位读者的利益而将其正规化。
这会产生足够的调用图,尽管它们似乎被Python的
if __main__:
pass条款。我只是在制作图表时把它注释掉了。
发布于 2020-10-05 18:44:15
您可以使用pyan.py生成调用图。有关详细信息,请参阅这堆栈溢出问题。
Usage: pyan.py FILENAME... [--dot|--tgf]
Analyse one or more Python source files and generate an approximate call graph
of the modules, classes and functions within them.
Options:
-h, --help show this help message and exit
--dot output in GraphViz dot format
--tgf output in Trivial Graph Format
-v, --verbose verbose output
-d, --defines add edges for 'defines' relationships [default]
-n, --no-defines do not add edges for 'defines' relationships
-u, --uses add edges for 'uses' relationships [default]
-N, --no-uses do not add edges for 'uses' relationships
-c, --colored color nodes according to namespace [dot only]
-g, --grouped group nodes (create subgraphs) according to namespace
[dot only]
-e, --nested-groups create nested groups (subgraphs) for nested namespaces
(implies -g) [dot only]https://softwarerecs.stackexchange.com/questions/52345
复制相似问题