#!/usr/bin/env python
#coding:utf-8

import sys

def show_caller(level=1):
    def show(func):
        def wrapper(*args, **kwargs):
            func(*args, **kwargs)
            print '{0.f_code.co_filename}:{0.f_lineno}'.format(sys._getframe(level)), "->", func.__name__
        return wrapper
    return show

@show_caller(1)
def foo():pass

 

相关文章:

  • 2021-06-14
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案