Say you have a package with this layout:
my_project/
my_app/
files/
im_a_file.txt
__init__.py
run_my_app.py
Say you have a package with this layout:
my_project/
my_app/
files/
im_a_file.txt
__init__.py
run_my_app.py
| import sys | |
| def j(lineno): | |
| frame = sys._getframe().f_back | |
| called_from = frame | |
| def hook(frame, event, arg): | |
| if event == 'line' and frame == called_from: | |
| try: | |
| frame.f_lineno = lineno |