https://github.com/juliendelplanque/pytrace
A function call tracker for Python.
https://github.com/juliendelplanque/pytrace
Last synced: 3 months ago
JSON representation
A function call tracker for Python.
- Host: GitHub
- URL: https://github.com/juliendelplanque/pytrace
- Owner: juliendelplanque
- License: gpl-2.0
- Created: 2015-11-02T19:45:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T20:24:30.000Z (over 9 years ago)
- Last Synced: 2025-02-11T11:53:29.685Z (5 months ago)
- Language: Python
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pytrace
A function calls/returns tracker for Python.[](https://asciinema.org/a/36177)
## 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_stringset_call_string("-->")
set_return_string("o<-")...
~~~