Skip to content
Discussion options

You must be logged in to vote

I am not sure if something like that exists. There are tools like strace on Linux or Truss on FreeBSD which allows you to "attach" to a process PID and see the system calls (read(), write(), close(), etc) in real time, as they are executed. In order to do the same for a Python process, and see exactly "where you are" in terms of code execution, you need the collaboration of the Python interpreter (sys._getframe() or whatever). In order to do what sys._getframe() does for an external python process I am afraid you have to build something from scratch, or search if there is something ready on PyPi. E.g. your Python process may listen on a TCP port on localhost, and once you connect to it it…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giampaolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2279 on November 12, 2026 14:08.