Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tracing function calls
#1
I am new python but consider myself little more than a beginner. I am working on somebody else's code and its a huge program. I want to understand how the program flows, like what functions are called and what are the object status at that time. I want to build a visual representation of the flow if possible. Tried below things but with little success.
1. I tried using the trace module with command-line but that throws calls to all function including the libraries I imported. I tried the ignore-dir/module but that doesn't seem to work. 
2. I also tried using the Trace function in code with output in a file (dat or txt), but that doesn't output the function call relationship. 
3. Another thing I tried is the event handling but that seems to work only when the function calls are within the same file.

What do programmers usually use to trace function calls, when the program is huge and is dealing with large dataset calculation? Is there a tool or some functionality with any IDE that would be helpful?

Note: I am using 2.7 in PyCharm and Sublime Text 3.
Reply
#2
One thing you can do that may help some.

Load the code into python from a command line: python ProgramName.py
once loaded, at the prompt type: help('ProgramName')
you should get a help listing with attributes, classes, methods, functions, etc

You can save this to a file see post: class that Redirects text from stdio to file

[url=http://python-forum.io/Thread-class-that-Redirects-text-from-stdio-to-file][/url]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  asyncio calls within sync function ( Websocket on_open) orion67 0 1,374 Jan-16-2022, 11:00 AM
Last Post: orion67
  question about flask tracing javidr 0 1,063 Aug-04-2021, 09:22 PM
Last Post: javidr
  Calls to Attributes of a Class SKarimi 3 3,336 Apr-22-2021, 04:18 PM
Last Post: SKarimi
  list call problem in generator function using iteration and recursive calls postta 1 1,862 Oct-24-2020, 09:33 PM
Last Post: bowlofred
  RuntimeError: Optimal parameters not found: Number of calls to function has reached m bntayfur 0 6,069 Aug-05-2020, 04:41 PM
Last Post: bntayfur
  Need help with a function that calls other functions. skurrtboi 4 2,458 Sep-30-2019, 09:28 PM
Last Post: stullis
  Tracing a multiplication table w/ Python trace() NationalRex22 0 1,728 Jun-11-2019, 03:31 AM
Last Post: NationalRex22
  How to split a string containing function calls? Metalman488 4 2,843 Oct-27-2018, 06:50 PM
Last Post: Metalman488
  Testing function calls jenselme 1 2,649 Jul-25-2018, 10:33 AM
Last Post: Larz60+
  function state between calls Skaperen 5 5,082 Feb-08-2018, 02:20 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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