To introduce my question let get an example.
I have a file code.py
. Let's say I run it, python code.py
which takes some time. Python starts a process, call it p0
.
Obviously changing code.py
during p0
won't change its execution, because the code, code.py
is loaded at the begining.
My point is then: is there a way, knowing p0
's pid
to see/print the python code currently used by p0
i.e. code.py
's "version" when p0
started?
I'm quite curious about how difficult this could be, and, as python isn't a compiled language, I think there may be the original python source, somewhere. Plus, it's quite hacky, but this could help me when I'm not 100% sure how was the code when I started a looooong process (then modified the file, yes that's not a really good pratice, must say).
Any clue? thx folks
pltrdy