Hi All,

I am trying to print out every function that is being called while my Python program is running (own functions and library calls too). I can not modify the Python programs I am trying to profile.

Let me give an example. A program contains a function like this:

def foo(x):
  y = math.cos(x)
  z = 1 + 1
  time.sleep(y+1)
  return x * 50

And it calls the function:

print foo(100)

I would like to retrieve an execution trace that shows me each function called with the value or hash of its arguments. According to the example, I am looking for a technique to extract something similar:

foo(100)
math.cos(100)
time.sleep(0.87)

Things I have tried with only partial success:
- trace module
- profile module / cProfile

Could you suggest me a way of doing this?

Thanks,
Richard
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to