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
  • 52,115
  • 13
  • 74
  • 94
00__00__00
  • 4,227
  • 8
  • 35
  • 72

0 Answers0