#coding=utf8

import sys

def test():
    gf = sys._getframe
    print dir(gf())
    print 'function name:',sys._getframe(1).f_code.co_name
    if sys._getframe(1).f_code.co_name != 'a':
        print 'Error'
    else:
        print 'Ok'

 


def a():
    test()

def b():
    test()

class t(object):
    def a(self):
        test()

if __name__ == '__main__':
    a()
    b()
    tt = t()
    tt.a()

 

相关文章:

  • 2021-08-02
  • 2022-12-23
  • 2022-01-01
  • 2021-09-18
  • 2021-05-22
  • 2022-12-23
  • 2022-03-09
  • 2022-01-19
猜你喜欢
  • 2022-12-23
  • 2021-09-30
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
相关资源
相似解决方案