Last active
June 27, 2022 14:34
-
-
Save kylegibson/6583590 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decorator import decorator | |
from line_profiler import LineProfiler | |
@decorator | |
def profile_each_line(func, *args, **kwargs): | |
profiler = LineProfiler() | |
profiled_func = profiler(func) | |
try: | |
profiled_func(*args, **kwargs) | |
finally: | |
profiler.print_stats() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am not able to see the Line Contents. Only the #hits, #time, etc are being shown. The output says
"Could not find file C:\Users\HP\AppData\Local\Temp\ipykernel_24440\670606222.py
Are you sure you are running this program from the same directory that you ran the profiler from?"
It used to work few months ago but suddenly now the above is happening. And I write my scripts in Onedrive with Anaconda Jupyter Lab. Please suggest what might be wrong. There is NO answer anywhere for this problem and I tried every possible way I could think of to solve it from 8 hours! Just to get the Line Contents so that I can begin my actual task of optimizing my code.