![]() |
How override ALL function calls? (Is there a "function call function"?)
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 |
Re: How override ALL function calls? (Is there a "function call function"?)
seberino@spawar.navy.mil 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 |
Re: How override ALL function calls? (Is there a "function call function"?)
On 31 Jul 2005 12:01:36 -0700, "seberino@spawar.navy.mil" <seberino@spawar.navy.mil> 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 |
| All times are GMT. The time now is 02:46 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.