Skip to content
forked from yrath/pytrace

Trace python program execution at runtime.

Notifications You must be signed in to change notification settings

raghakot/pytrace

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytrace

Get information on python program execution (e.g. functions called, lines executed) at runtime.

Installation

pip install git+https://github.com/yrath/pytrace.git

Examples

The tracer can be created as a context manager as follows:

import os
from pytrace.tracer import trace_execution

class TestClass(object):
    def set_value(self, value):
        self.value = value

def run():
    test_inst = TestClass()
    test_inst.set_value(3)

with trace_execution(traced_paths=[os.path.abspath(__file__)]) as tracer:
    run()

which will output

pytrace output

Note that starting with python 3.2, the context manager can also be used as a decorator with @trace_execution().

The tracer can also be used from the command line with

pytrace example.py

About

Trace python program execution at runtime.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%