Executing previous stack frame

sturlamolden sturlamolden at yahoo.no
Thu Jan 22 09:49:14 EST 2009


frame = sys._getframe().f_back is the previous stack frame. Is there
any way to execute (with exec or eval) frame.f_code beginning from
frame.f_lasti or frame.f_lineno?

I am trying to spawn a thread that is initialized with the code and
state of the previous stack frame.


S.M.





More information about the Python-list mailing list