How override ALL function calls? (Is there a "function call function"?)

Discussion in 'Python' started by seberino@spawar.navy.mil, Jul 31, 2005.

  1. Guest

    I'm trying run a homegrown profiler on some Python code.

    Rather than apply profiler wrapper to ALL functions by hand....

    Is there a low level Python function I can override to modify

    how ALL functions are called?

    Chris
     
    , Jul 31, 2005
    #1
    1. Advertising

  2. wrote:
    > I'm trying run a homegrown profiler on some Python code.
    >
    > Rather than apply profiler wrapper to ALL functions by hand....
    >
    > Is there a low level Python function I can override to modify
    >
    > how ALL functions are called?


    Yes, please take a look at sys.setprofile().

    Regards,
    Martin
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Jul 31, 2005
    #2
    1. Advertising

  3. On 31 Jul 2005 12:01:36 -0700, "" <> wrote:

    >I'm trying run a homegrown profiler on some Python code.
    >
    >Rather than apply profiler wrapper to ALL functions by hand....
    >
    >Is there a low level Python function I can override to modify
    >
    >how ALL functions are called?
    >

    You may want to look at

    >>> import sys
    >>> help(sys.settrace)

    Help on built-in function settrace in module sys:

    settrace(...)
    settrace(function)

    Set the global debug tracing function. It will be called on each
    function call. See the debugger chapter in the library manual.

    Regards,
    Bengt Richter
     
    Bengt Richter, Aug 1, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Bär
    Replies:
    2
    Views:
    433
    Yan-Hong Huang[MSFT]
    Jul 18, 2003
  2. Honne Gowda A
    Replies:
    2
    Views:
    913
    Karl Heinz Buchegger
    Oct 31, 2003
  3. andy6
    Replies:
    2
    Views:
    793
    andy6 via DotNetMonster.com
    Jun 9, 2006
  4. Richard Tobin
    Replies:
    24
    Views:
    825
  5. Bob
    Replies:
    5
    Views:
    290
Loading...

Share This Page