获取行号:

def get_file():
    print("文件名 :",__file__,sys._getframe().f_lineno)
    print("函数名: ", sys._getframe().f_code.co_name)
    print("模块名: ", sys._getframe().f_back.f_code.co_name) 

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2021-11-27
  • 2022-12-23
  • 2022-02-04
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-09-13
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
相关资源
相似解决方案