python 查看调用函数的方法

来源:互联网 发布:易语言编写软件 编辑:程序博客网 时间:2024/06/06 15:03
>>> import inspect>>> def f1(): f2()... >>> def f2():...   curframe = inspect.currentframe()...   calframe = inspect.getouterframes(curframe, 2)...   print 'caller name:', calframe[1][3]... >>> f1()caller name: f1>>> 
0 0
原创粉丝点击