0

I have a function in python. Is there a way to get the number of lines of code that the function has in the original source file?

e.g.

# main.py

import f1 from mylib

print(loc(f1)) # 3

# mylib

def f1():
  pass
  return 
khelwood
  • 55,782
  • 14
  • 81
  • 108
00__00__00
  • 4,834
  • 9
  • 41
  • 89

0 Answers0