[BangPypers] Tools/libraries to determine the call graph(call flow) of an python program (module/package)

Vasudev Ram vasudevram at gmail.com
Tue Jan 12 05:01:16 EST 2016


Have you tried the trace module from the stdlib?

https://docs.python.org/2/library/trace.html

Has both a CLI and a lib you can use.

See this example:

http://jugad2.blogspot.tw/2013/06/pythons-trace-module-and-chained.html

Also this:

http://jugad2.blogspot.in/2013/04/using-syscurrentframes-and-python.html

- Vasudev
jugad2.blogspot.com

On Tuesday, January 12, 2016, ashish makani <ashish.makani at gmail.com> wrote:

> Hi fellow bangalore pythonistas ,
>
> I am trying to do the following.
>
> I have a moderately complex python module/application X, whose source code
> i have access to.
>
> I run X with the following command
>
> python x.py <arg1> <arg2> ... <argn>
>
>
> Internally, x.py callls y.py, which in turn calls z.py, etc etc
>
> x.py ---> y.py ---> z.py ---> u.py ---> v.py
>
> Is there a python library/tool/module , to which i give input the start
> point of X, x.py
> and the input arguments, arg1, arg2, ..., argn
>
> and which can come up with the call graph of X
>
> I have tried looking at pycallgraph[0], but havent had much luck with it.
> 0. https://pypi.python.org/pypi/pycallgraph
>
> Any suggestions,advice, pointers welcome.
>
> Thanks a ton,
> ashish
>
>
> *"Talk is cheap. Show me the code."    - Linus Torvalds [*
> * https://lkml.org/lkml/2000/8/25/132* <
> https://lkml.org/lkml/2000/8/25/132>
> * ]*
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org <javascript:;>
> https://mail.python.org/mailman/listinfo/bangpypers
>


-- 
Vasudev Ram - Dancing Bison Enterprises
Fellow at the Python Software Foundation
Independent software consultant and trainer
- Python, C, Linux, databases, open source
About: http://jugad2.blogspot.in/p/about-vasudev-ram.html
LinkedIn: http://www.linkedin.com/in/vasudevram
ActiveState Code recipes:
https://code.activestate.com/recipes/users/4173351


More information about the BangPypers mailing list