Get frame object of last called function

Discussion in 'Python' started by moerchendiser2k3, Nov 6, 2010.

  1. Hi, is there any chance to get the frame object of the previous called
    function?
    I just find the 'f_back' frame object but this is the frame object of
    the parent function,
    not the previous one.

    I try to get the line number of the exit point of the previous
    function.


    (0) def Test():
    (1) print "OK"
    (2) return "Foo"

    p = Test()
    #get the line number where Test() returned

    Any ideas? Thanks a lot!

    Bye, moerchendiser
    moerchendiser2k3, Nov 6, 2010
    #1
    1. Advertising

  2. moerchendiser2k3

    Aahz Guest

    In article <>,
    moerchendiser2k3 <> wrote:
    >
    >Hi, is there any chance to get the frame object of the previous called
    >function?


    sys._current_frames(), sys._getframe()
    --
    Aahz () <*> http://www.pythoncraft.com/

    "Think of it as evolution in action." --Tony Rand
    Aahz, Dec 2, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gigi
    Replies:
    3
    Views:
    320
  2. Vijay Kumar
    Replies:
    0
    Views:
    275
    Vijay Kumar
    May 17, 2005
  3. anonymous
    Replies:
    3
    Views:
    392
    S.Tobias
    Jan 13, 2005
  4. anonymous
    Replies:
    4
    Views:
    744
    S.Tobias
    Jan 28, 2005
  5. Nick Keighley

    last function to be called

    Nick Keighley, Feb 5, 2007, in forum: C++
    Replies:
    3
    Views:
    296
    Alan Johnson
    Feb 6, 2007
Loading...

Share This Page