Python Forum
How to intercept python method calls?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to intercept python method calls?
#1
Hello,
I have a python program running as process. I am looking for mechanism to intercept selected function in python program which is already running (at run time) and get the control of the function.
Example:
def function1():
   try{
       .....
   } catch(exception ex) {
       .....
   }
Let's say, the above specified function is part of the python program running. I am looking for a mechanism using which I can instruct python to return the exception each time the function1 is called (irrespective of try condition).
I have come across parasite project which allows us to connect to running process and execute a code but, doesn't seem to help in controlling behavior of a method in the target process.

Thanks,
Dinesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calls to Attributes of a Class SKarimi 3 3,334 Apr-22-2021, 04:18 PM
Last Post: SKarimi
  slope intercept form Dasiey12 6 3,910 Jun-14-2020, 06:34 PM
Last Post: SheeppOSU
  Need help with a function that calls other functions. skurrtboi 4 2,455 Sep-30-2019, 09:28 PM
Last Post: stullis
  Python script that calls jamfHelper binary kennethdean2010 19 6,996 May-07-2019, 03:50 PM
Last Post: kennethdean2010
  Multiple calls to Python interpreter embedded in C++ application yield segmentation f mmoelle1 0 2,792 Mar-21-2019, 08:54 PM
Last Post: mmoelle1
  Testing function calls jenselme 1 2,649 Jul-25-2018, 10:33 AM
Last Post: Larz60+
  function state between calls Skaperen 5 5,081 Feb-08-2018, 02:20 AM
Last Post: Skaperen
  Is there another way to do a bunch of methods calls ? Windspar 7 4,619 Jan-02-2018, 06:26 PM
Last Post: Windspar
  Tracing function calls PyRaider 1 3,800 Oct-25-2016, 03:44 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020