So I have this project I'm working on that has some debug features that I wouldn't want to be in the final project. So, I want to make a function that tells me where it was called so I can call it by the debug code and have it tell me in the console what line number it's on. I've tried using the getframeinfo and currentframe methods from the inspect library but those didn't work for what I wanted to do:
1 from inspect import currentframe, getframeinfo
2
3
4 def mark():
5 frameInfo = getframeinfo(currentframe())
6 print(frame.lineon)
7
8
9 mark()
output: 6