I've been given a Python code, together with the modules it imports. I would like to build a tree indicating which function calls what other functions. How can I do that?
I've been given a Python code, together with the modules it imports. I would like to build a tree indicating which function calls what other functions. How can I do that?
you can use the
ast
(abstract syntax tree) module from the python standard libraryparsing the file using
ast.parse
:outputs: