A function call tracker for Python.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
examples.py
pytrace.py

README.md

pytrace

A function calls/returns tracker for Python.

asciicast

How to use me?

Simply download the script pytrace.py and put it in your project directory.

# In your project directory:
$ wget https://raw.githubusercontent.com/juliendelplanque/pytrace/master/pytrace.py 

Then add the following lines in the file where is located the function you want to trace.

from pytrace import function_to_trace
function_to_trace(the_function_you_will_track)

This will print function calls/returns in the console!

Examples

See examples.py

What if your terminal does not supports UTF-8?

You can change the strings used to represent function calls/returns using set_call_string and set_return_string.

For example:

from pytrace import function_to_trace, set_call_string, set_return_string

set_call_string("-->")
set_return_string("o<-")

...